    <SEC-DOCUMENT>0000950170-25-066913-index.html : 20250508
    <SEC-HEADER>0000950170-25-066913.hdr.sgml : 20250508
    <ACCEPTANCE-DATETIME>20250508160526
    ACCESSION NUMBER:		0000950170-25-066913
    CONFORMED SUBMISSION TYPE:	8-K
    PUBLIC DOCUMENT COUNT:		19
    CONFORMED PERIOD OF REPORT:	20250508
    ITEM INFORMATION:		Results of Operations and Financial Condition
    ITEM INFORMATION:		Financial Statements and Exhibits
    FILED AS OF DATE:		20250508
    DATE AS OF CHANGE:		20250508

    FILER:

    	COMPANY DATA:
    		COMPANY CONFORMED NAME:			TREX CO INC
    		CENTRAL INDEX KEY:			0001069878
    		STANDARD INDUSTRIAL CLASSIFICATION:	LUMBER & WOOD PRODUCTS (NO FURNITURE) [2400]
    		ORGANIZATION NAME:           	04 Manufacturing
    		EIN:				541910453
    		STATE OF INCORPORATION:			DE
    		FISCAL YEAR END:			1231

    	FILING VALUES:
    		FORM TYPE:		8-K
    		SEC ACT:		1934 Act
    		SEC FILE NUMBER:	001-14649
    		FILM NUMBER:		25925929

    	BUSINESS ADDRESS:
    		STREET 1:		2500 TREX WAY
    		CITY:			WINCHESTER
    		STATE:			VA
    		ZIP:			22601
    		BUSINESS PHONE:		5405426300

    	MAIL ADDRESS:
    		STREET 1:		2500 TREX WAY
    		CITY:			WINCHESTER
    		STATE:			VA
    		ZIP:			22601
    </SEC-HEADER>
    <DOCUMENT>
    <TYPE>8-K
    <SEQUENCE>1
    <FILENAME>trex-20250508.htm
    <DESCRIPTION>8-K
    <TEXT>
    Document 1 - file: trex-20250508.htm

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>EX-99.1
    <SEQUENCE>2
    <FILENAME>trex-ex99_1.htm
    <DESCRIPTION>EX-99.1
    <TEXT>
    Document 2 - file: trex-ex99_1.htm

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>3
    <FILENAME>img196323604_0.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 3 - file: img196323604_0.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>4
    <FILENAME>img196323604_1.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 4 - file: img196323604_1.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>5
    <FILENAME>img196323604_2.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 5 - file: img196323604_2.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>6
    <FILENAME>img196323604_3.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 6 - file: img196323604_3.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>7
    <FILENAME>img196323604_4.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 7 - file: img196323604_4.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>8
    <FILENAME>img196323604_5.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 8 - file: img196323604_5.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>GRAPHIC
    <SEQUENCE>9
    <FILENAME>img196323604_6.jpg
    <DESCRIPTION>GRAPHIC
    <TEXT>
    Document 9 - file: img196323604_6.jpg

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>EX-101.SCH
    <SEQUENCE>10
    <FILENAME>trex-20250508.xsd
    <DESCRIPTION>XBRL TAXONOMY EXTENSION SCHEMA WITH EMBEDDED LINKBASES DOCUMENT
    <TEXT>
    Document 10 - file: trex-20250508.xsd

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>XML
    <SEQUENCE>12
    <FILENAME>R1.htm
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 12 - file: R1.htm

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>EXCEL
    <SEQUENCE>13
    <FILENAME>Financial_Report.xlsx
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 13 - file: Financial_Report.xlsx

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>XML
    <SEQUENCE>14
    <FILENAME>Show.js
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 14 - file: Show.js

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>XML
    <SEQUENCE>15
    <FILENAME>report.css
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 15 - file: report.css

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>XML
    <SEQUENCE>17
    <FILENAME>FilingSummary.xml
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 17 - file: FilingSummary.html

    Document 17 - RAW XML: FilingSummary.xml

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>JSON
    <SEQUENCE>19
    <FILENAME>MetaLinks.json
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 19 - file: MetaLinks.json

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>ZIP
    <SEQUENCE>20
    <FILENAME>0000950170-25-066913-xbrl.zip
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 20 - file: 0000950170-25-066913-xbrl.zip

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>XML
    <SEQUENCE>21
    <FILENAME>trex-20250508_htm.xml
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 21 - file: trex-20250508_htm.html

    Document 21 - RAW XML: trex-20250508_htm.xml

    </DOCUMENT>
    </SEC-DOCUMENT>