Of the 570 best places to work in the country, 34 have locations in Massachusetts, according to Energage, the company that compiles The Boston Globe’s annual Top Places to Work rankings of employers statewide.

And three Massachusetts organizations ranked in the top five in their size categories: HubSpot, the Cambridge marketing software company, was No. 3 among employers with 1,000-2,499 employees; Harvard Pilgrim, the Wellesley-based health insurance company, ranked fifth in the same category. And Enterprise Bank in Lowell came in second among employers with 500-999 employees.

HubSpot and Enterprise Bank both ranked first in the Globe’s 2020 rankings.

The national rankings, which mark the first time Energage has compiled such a list, were determined using anonymous employee surveys of more than 1,100 companies nationwide taken in 2020. The survey consists of 24 questions about engagement, leadership, connection, company values, benefits, and more.

Overall, Texas has the most companies on the list, with 50 winners, followed by 38 in Illinois and 35 in Ohio — in part due to the robust programs Energage already runs in those states.

The No. 1 employer in each size category is based in the Midwest, including two mortgage companies: Fairway Independent Mortgage Corp. in Madison, Wis. (2,500-plus workers); Union Home Mortgage Corp. in Strongsville, Ohio (,1000-2,499); Assurance in Schaumburg, Ill. (500-599); and Cooperative Association for Special Education in Glen Ellyn, Ill. (150-499).

At a time when remote work is on the rise, a company’s physical location matters less than it used to. But it’s still nice to know there are some top-ranking organizations nearby.

To nominate a company for the 2021 Boston Globe Top Places to Work, go to https://topworkplaces.com/nominate/boston/.

Katie Johnston can be reached at katie.johnston@globe.com. Follow her on Twitter @ktkjohnston.