Worried about rising medical costs? There's an investment account that can help.

Health savings accounts (HSAs) are tax-exempt trust accounts that pay or reimburse medical expenses for you or your family if you have a healthcare plan with an annual deductible of $1,350 or $2,700 or more, respectively. The accounts, which you can open through your employer or financial institution, allow you to fund your account with pre-tax income from your paycheck.

Even better, HSAs offer two more tax benefits. You earn tax-free interest on your funds, and if you withdraw funds for medical expenses, you aren't assessed for a tax penalty. 

"HSAs have the most tax advantages of any account out there," Mychal Eagleson, president of a financial consulting firm An Exceptional Life Financial, told TheStreet. Congress approved the creation of HSAs in 2003 to lessen burdens brought on by growing medical costs and high-deductible health plans.

Like a 401(k), the account's funds can be invested in various securities such as stocks, mutual funds or ETFs although different institutions may require a minimum balance to make certain investments. The maximum annual contributions are $3,450 for individuals and $6,900 for a family. Those over 55 can add another $1,000 as a catch-up contribution. Also, you're allowed to move the account from one employer or financial institution to another.

If you're a healthy millennial, it's advisable to take an HSA-qualified plan and put any money you're saving with the lower monthly payment into the HSA. Since HSAs are tied to high-deductible health plans, Eagleson advises seniors or those with a chronic condition to stick with a standard PPO/HMO.

For millennials, though, retirement may seem to be a lifetime away, until it's not. Here's something to consider. According to Fidelity Investments, a 65-year-old couple retiring this year will need an estimated $280,000 to cover their healthcare costs throughout retirement based on the average life expectancies and assuming both are eligible for Medicare. This number, of course, rises every year.

If you're stretched for cash, know that you don't need much money to get your HSA started. Because of its structure, HSAs with small balances can benefit you also.

"Let's say you have just $20 in your HSA and you have an accident resulting in $3,000 in medical bills," Jim Shagawat, president of Windfall Wealth Advisors, told TheStreet. "You will have to pay the bill out-of-pocket, or with funds you've already paid taxes on. Then, over time, re-fund your HSA through contributions. When you have $3,000, you can reimburse yourself with tax-free funds as a reimbursement from the HSA."

Just remember to hang on to your medical receipts in case the Internal Revenue Service has questions.

And one more thing, Chris Byrd, executive vice president of the healthcare financial technology platform provider WEX Health Inc., told TheStreet: "Look at an HSA the same way as a 401(k), in that you can never start too early."

More from Investing

Judge Cuts Jury Award against Bayer's Roundup to $78.5 Million

Judge Cuts Jury Award against Bayer's Roundup to $78.5 Million

Chart of the Day: Google's Waymo Offers Way More Opportunity for Fiat Investors

Chart of the Day: Google's Waymo Offers Way More Opportunity for Fiat Investors

Fiat Chrysler Cashes In on $7 Billion Auto Parts Sale on Monday

Fiat Chrysler Cashes In on $7 Billion Auto Parts Sale on Monday

Why Salesforce.com Is One of Jim Cramer's 10 Best Stocks for a Market Pullback

Why Salesforce.com Is One of Jim Cramer's 10 Best Stocks for a Market Pullback

The Big Problem Is That Buyers Have No Sense of Urgency Now

The Big Problem Is That Buyers Have No Sense of Urgency Now