XML 18 R1.htm IDEA: XBRL DOCUMENT v3.24.0.1
Cover Page - USD ($)
$ in Billions
12 Months Ended
Dec. 31, 2023
Feb. 12, 2024
Jun. 30, 2023
Cover [Abstract]      
Amendment Flag false    
Document Fiscal Year Focus 2023    
Document Type 10-K    
Document Fiscal Period Focus FY    
Entity Central Index Key 0001069878    
Current Fiscal Year End Date --12-31    
Document Transition Report false    
Entity Registrant Name TREX CO INC    
Document Period End Date Dec. 31, 2023    
Entity Current Reporting Status Yes    
Entity Interactive Data Current Yes    
Trading Symbol TREX    
Entity Shell Company false    
Entity Filer Category Large Accelerated Filer    
Entity Small Business false    
Entity Emerging Growth Company false    
Entity Common Stock, Shares Outstanding   108,623,606  
Entity File Number 001-14649    
Entity Incorporation, State or Country Code DE    
Entity Tax Identification Number 54-1910453    
Entity Address, Address Line One 2500 Trex Way    
Entity Address, City or Town Winchester    
Entity Address, Postal Zip Code 22601    
Entity Address, State or Province VA    
City Area Code 540    
Local Phone Number 542-6300    
Title of 12(b) Security Common stock    
Security Exchange Name NYSE    
Document Annual Report true    
Entity Well-known Seasoned Issuer No    
Entity Voluntary Filers No    
Entity Public Float     $ 7.1
ICFR Auditor Attestation Flag true    
Document Financial Statement Error Correction [Flag] false    
Auditor Name Ernst & Young LLP    
Auditor Firm ID 42    
Auditor Location Tysons, Virginia