In the fourth quarter, net sales were $196 million, 8.4% above the $181 million of net sales reported in last year’s fourth quarter. This growth was driven by increased volume and the absence of the residual channel inventory destocking we experienced in the fourth quarter of 2022. Gross margin was 36.1%, flat with last year’s fourth quarter and above expectations.
Selling, general and administrative expenses were $42.5 million, or 21.7% of net sales, in the fourth quarter, compared to $32 million, or 18% of net sales, a year ago. As discussed in prior quarters, we have returned to more normalized SG&A spending levels as we continue to see positive returns from our branding, marketing and R&D initiatives.
In addition to the normalization of our marketing, fourth quarter SG&A was elevated due to the spending related to new product launches for 2024. Net income was $22 million in the fourth quarter, or $0.20 per diluted share, compared to $24 million, or $0.22 per diluted share, in the fourth quarter of 2022. We delivered EBITDA of $41 million, or 21% of net sales, compared to $44 million, or 24.1% of net sales, in the year-ago quarter.
Moving to a brief overview of our full year results, net sales totaled $1.095 billion in 2023 compared to $1.060 billion in 2022, which, despite moving the early buy program out of Q4 2023 and into the first half of 2024, is an increase of $35 million or 3% growth over the prior year.
Gross margin expanded by 360 basis points to 41.3% from 37.7% in 2022. This year’s gross margin benefited from the absence of the inventory recalibration done by our channel partners in 2022. Additionally, our cost-out initiatives and improved plant performance were important contributors to the gross margin recovery and more than offset the higher depreciation and utility costs.
Selling, general and administrative expenses were $176 million in 2023, or 16% of net sales, compared to $132 million, or 12.4% of net sales, in 2022. The year-over-year increase is driven by additional investments in branding, marketing and R&D which continue to provide good returns.
Full year 2023 net income was $205 million, or $1.89 per diluted share, compared to $201 million, or $1.80 per diluted share. We delivered full year EBITDA of $326 million, up from $311 million, and EBITDA margin expanded to 29.8%, a 40-basis point improvement from the 29.4% reported in 2022.
During the 2023 fiscal year, we recognized a benefit of $3.8 million from a reduction in the Trex Residential warranty reserve related to the surface flaking issues that affected a portion of our products manufactured at the Nevada plant before 2007. Excluding the warranty benefit, 2023 adjusted gross margin was 41%.
Adjusted net income was $203 million, or $1.86 per diluted share. Adjusted EBITDA was $323 million, and the adjusted EBITDA margin was 29.5%.
We generated a healthy consolidated operating cash flow of $389 million, considerably higher than the $216 million in 2022. Capital expenditures were $166 million primarily related to the build-out of the Arkansas manufacturing facility.
4