    <SEC-DOCUMENT>0001193125-25-226786-index.html : 20251001
    <SEC-HEADER>0001193125-25-226786.hdr.sgml : 20251001
    <ACCEPTANCE-DATETIME>20251001161527
    ACCESSION NUMBER:		0001193125-25-226786
    CONFORMED SUBMISSION TYPE:	8-K
    PUBLIC DOCUMENT COUNT:		13
    CONFORMED PERIOD OF REPORT:	20251001
    ITEM INFORMATION:		Departure of Directors or Certain Officers; Election of Directors; Appointment of Certain Officers: Compensatory Arrangements of Certain Officers
    ITEM INFORMATION:		Regulation FD Disclosure
    ITEM INFORMATION:		Financial Statements and Exhibits
    FILED AS OF DATE:		20251001
    DATE AS OF CHANGE:		20251001

    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:		251364811

    	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-20251001.htm
    <DESCRIPTION>8-K
    <TEXT>
    Document 1 - file: trex-20251001.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>EX-101.SCH
    <SEQUENCE>5
    <FILENAME>trex-20251001.xsd
    <DESCRIPTION>XBRL TAXONOMY EXTENSION SCHEMA WITH EMBEDDED LINKBASES DOCUMENT
    <TEXT>
    Document 5 - file: trex-20251001.xsd

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

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

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

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

    Document 11 - RAW XML: FilingSummary.xml

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

    </DOCUMENT>
    <DOCUMENT>
    <TYPE>ZIP
    <SEQUENCE>14
    <FILENAME>0001193125-25-226786-xbrl.zip
    <DESCRIPTION>IDEA: XBRL DOCUMENT
    <TEXT>
    Document 14 - file: 0001193125-25-226786-xbrl.zip

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

    Document 15 - RAW XML: trex-20251001_htm.xml

    </DOCUMENT>
    </SEC-DOCUMENT>