Exhibit 23.1

Consent of Independent Registered Public Accounting Firm
We consent to the incorporation by reference in the Registration Statement (No. 333-268833) on Form S-8 of John Marshall Bancorp, Inc. of our report dated March 28, 2025, relating to the consolidated financial statements of John Marshall Bancorp, Inc., appearing in the Annual Report on Form 10-K of John Marshall Bancorp, Inc. for the year ended December 31, 2024.
/s/ Yount, Hyde & Barbour, P.C.
Richmond, Virginia
March 28, 2025