Exhibit 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We hereby consent to the incorporation by reference in the Registration Statements on Form S-8 (Nos. 333-205395 and 333-205396) of TopBuild Corp. of our report dated December 29, 2021 relating to the financial statements of DI Super Holdings, Inc., which appears in this Current Report on Form 8-K/A.

/s/ PriceWaterhouseCoopers LLP

Houston, Texas

December 29, 2021