People can spend the money in their health savings accounts on current medical bills, or they may choose to invest their balance to pay for health costs in retirement.

But it turns out that some HSAs are better than others, according to a report by the research firm Morningstar.

The report ranks 10 prominent HSAs on their suitability for savers or investors. “People generally use it for one approach or the other,” said Leo Acheson, a Morningstar senior analyst. So the choice of account “should be based on what you want to accomplish.”

HSAs are tax-favored accounts that let users set aside money for health care costs their insurance doesn’t cover. Money is deposited tax free, grows tax free and can be withdrawn tax free as long as it is spent on health and medical expenses. There is no deadline for spending the cash, and if you change jobs, the money goes with you.

The accounts are often offered by employers, but people can sign up on their own if one isn’t available through their workplace. The main catch is that not everyone can use them: The accounts can be opened only by people who also have specific types of health insurance plans with high deductibles. (For 2017, that amount is at least $1,300 for individuals, $2,600 for a family.)

The accounts have been around for more than a decade, but have been growing recently as employers seek to shift health care costs to workers.

At the end of 2016, the number of HSA accounts rose 20 percent, to 20 million, from the year before, according to Devenir, a provider of HSA services. The accounts hold nearly $37 billion.

In its report, Morningstar ranked the HSAs on criteria like monthly maintenance fees and ease of access for those spending the funds on current costs, and the menu of mutual funds offered. Just one ranked well on both: the HSA Authority, offered through Old National Bank in Evansville, Ind.

For people spending their money now, monthly account maintenance fees are the most important factor, Acheson said; interest rates paid on savings are still so low that they generally aren’t significant. While the accounts are referred to as savings accounts, spenders use them more like checking accounts, typically using a debit card to pay bills.

Spenders should look for an HSA with no or a low monthly account fee.

The top HSAs for spending were Alliant Credit Union, the HSA Authority, and Select Account, none of which charge a monthly maintenance fee. Bank of America, which came in at the bottom of the list, charges a monthly fee of $4.50.

On the investment side, the report found plenty of room for improvement. For investors, Morningstar looked at the variety of asset classes available, the quality of funds based on their likelihood of outperforming benchmarks and the total cost of the funds. Most HSAs require account holders to have a minimum balance before investing, typically at least $1,000.

Some health savings accounts received low marks for having an overwhelming number of mutual fund options — too much choice for the typical investor to digest, Morningstar reasoned.

Four accounts — those from Health Equity, Optum Bank, the HSA Authority and Bank of America — received overall positive assessments. All got good marks for pricing, based on a combination of fees charged for their underlying funds, as well as additional maintenance and investment fees. All four had overall combined expense ratios of less than 1 percent.

Health Equity, the only account that received top marks for all of Morningstar’s criteria, offers only Vanguard funds, a majority of which are low-cost index funds. The HSA charges hefty fees, but the overall expense ratio is still favorable, Morningstar found.

Here are some questions and answers about HSAs:

Q: If I don’t like the investment choices offered with my employer’s HSA, am I stuck with it?

A: If you’re unhappy, there is a workaround. You can let your employer continue making contributions to your workplace account and have your payroll deductions flow into it as well. Then, periodically, you can transfer the money to a separate HSA that you have set up with your preferred provider. Just be sure you meet any minimum balance requirement in your company’s HSA, so you don’t get hit with penalty fees, said Roy Ramthun, an HSA consultant. 

Q: How much can I put into an HSA each year?

A: For 2017, the contribution limit (including those from employer and employee combined) is $3,400 for an individual and $6,750 for a family, plus an extra $1,000 catch-up contribution for people 55 and older. 

Q: Is a health savings account the same as a flexible health spending account?

A: No. Both offer tax advantages, but there are important differences. For example, you don’t have to be enrolled in a high-deductible health plan to use an FSA. 

Ann Carrns writes for the New York Times.