Exhibit 31.1

Certifications

I, Robert Buck, certify that:

1.I have reviewed this quarterly report on Form 10-Q/A of TopBuild Corp.; and
2.Based on my knowledge, this report does not contain any untrue statement of a material fact or omit to state a material fact necessary to make the statements made, in light of the circumstances under which such statements were made, not misleading with respect to the period covered by this report.

Date: November 7, 2024

/s/ Robert Buck

Robert Buck

Chief Executive Officer and Director

(Principal Executive Officer)