Exhibit 5.1

December 12, 2025 | Chicago New York Washington, DC London San Francisco Los Angeles Singapore Dallas Miami vedderprice.com

HBT Financial, Inc. 401 North Hershey Road Bloomington, Illinois 61704

| Re: | Registration Statement on Form S-4 of HBT Financial, Inc.

Ladies and Gentlemen:

We have acted as special counsel to HBT Financial, Inc., a Delaware corporation (“HBT”), in connection with the Registration Statement on Form S-4 (the “Registration Statement”) being filed under the Securities Act of 1933, as amended (the “Securities Act”), by HBT with the Securities and Exchange Commission (the “Commission”) for the purpose of registering under the Securities Act up to 5,513,480 shares of HBT’s common stock, par value $0.01 per share (the “Registered Shares”). The Registered Shares may be issued by HBT pursuant to the Agreement and Plan of Merger, dated as of October 20, 2025 (the “Merger Agreement”), by and between HBT, HBT-CNB Merger, Inc., a Delaware corporation and wholly-owned subsidiary of HBT, and CNB Bank Shares, Inc., an Illinois corporation (“CNB”), which provides for, among other things, the merger of CNB with and into HBT, with HBT as the surviving corporation (the “Merger”). This opinion is being furnished in accordance with the requirements of Item 601(b)(5) of Regulation S-K under the Securities Act.

In rendering this opinion, we have examined such documents and materials, including the Registration Statement, the Merger Agreement, HBT’s Restated Certificate of Incorporation and Amended and Restated By-laws, as currently in effect, the resolutions of each of the Board of Directors of HBT and Heartland Bank and Trust Company relating to the Merger, each dated as of October 17, 2025 and such other corporate documents and records of HBT as we have deemed necessary or appropriate for the purpose of and as a basis for rendering this opinion. In our investigation, we have assumed the genuineness of all signatures, the authenticity of all documents submitted to us as originals, the conformity to the original documents of all documents submitted to us as copies, and the authenticity of the originals of such copies. As to matters of fact, we have relied upon representations of officers of HBT.

Our opinion is limited to the applicable provisions of the General Corporation Law of the State of Delaware and the federal laws of the United States of America. We express no opinion with respect to the laws of any other jurisdiction.

On the basis of the foregoing, and subject to the qualifications, assumptions and limitations set forth herein, it is our opinion that, when the Registration Statement has been declared effective under the Securities Act by order of the Commission and the Merger is consummated in accordance with the terms of the Merger Agreement, each Registered Share, if and when issued to CNB’s shareholders in accordance with and pursuant to the Merger Agreement, will be validly issued, fully paid and nonassessable.

222 North LaSalle Street | Chicago, IL 60601 | T +1 312 609 7500 | F +1 312 609 5005

Vedder Price P.C. is affiliated with Vedder Price LLP, which operates in England and Wales, Vedder Price (CA), LLP, which operates in California, Vedder Price Pte. Ltd., which operates in Singapore, and Vedder Price (FL) LLP, which operates in Florida.

HBT Financial, Inc.

December 12, 2025

Page 2

We hereby consent to the filing and inclusion of this opinion as an exhibit to the Registration Statement and to the reference to our name under the heading “Validity of Securities” in the proxy statement/prospectus included therein. In giving this consent, we do not admit thereby that we are included in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations of the Commission promulgated thereunder.

Very truly yours, /s/ Vedder Price P.C. |