Exhibit 5.1

|  | Goodwin Procter LLP
| Counselors at Law
| Exchange Place
| Boston, MA 02109
| T: 617.570.1000
| F: 617.523.1231

March 13, 2015

HubSpot, Inc.

25 First Street, 2nd Floor

Cambridge, Massachusetts 02141

| Re: | Securities Registered under Registration Statement on Form S-1

Ladies and Gentlemen:

We have acted as counsel to you in connection with your filing of a Registration Statement on Form S-1 (File No. 333- 202535) (as amended or supplemented, the “Registration Statement”) pursuant to the Securities Act of 1933, as amended (the “Securities Act”), relating to the registration of the offering by HubSpot, Inc., a Delaware corporation (the “Company”) of up to 4,731,658 shares (the “Shares”) of the Company’s Common Stock, $0.001 par value per share, which include up to 977,508 shares of Common Stock (the “Company Shares”) to be newly issued and sold by the Company and up to 3,754,150 shares of Common Stock (the “Selling Stockholder Shares”) to be sold by the selling stockholders listed in the Registration Statement under “Principal and Selling Stockholders” (the “Selling Stockholders”), including Shares purchasable by the underwriters upon their exercise of an over-allotment option granted to the underwriters by the Company. The Shares are being sold to the several underwriters named in, and pursuant to, an underwriting agreement among the Company and such underwriters (the “Underwriting Agreement”).

We have reviewed such documents and made such examination of law as we have deemed appropriate to give the opinions set forth below. We have relied, without independent verification, on certificates of public officials and, as to matters of fact material to the opinions set forth below, on certificates of officers of the Company.

The opinion set forth below is limited to the Delaware General Corporation Law (which includes reported judicial decisions interpreting the Delaware General Corporation Law).

Based on the foregoing, we are of the opinion that (i) the Company Shares have been duly authorized and, upon issuance and delivery against payment therefor in accordance with the terms of the Underwriting Agreement, the Company Shares will be validly issued, fully paid and non-assessable and (ii) the Selling Stockholder Shares have been duly authorized and validly issued and are fully paid and non-assessable.

We hereby consent to the inclusion of this opinion as Exhibit 5.1 to the Registration Statement and to the references to our firm under the caption “Legal Matters” in the Registration Statement. In giving our consent, we do not admit that we are in the category of persons whose consent is required under Section 7 of the Securities Act or the rules and regulations thereunder.

Very truly yours,
/s/ Goodwin Procter LLP
GOODWIN PROCTER LLP