What's the difference between HSAs and the flexible-spending accounts? It seems they are for the same purpose.

The tax benefits of both plans are quite similar, but there are several differences. The biggest and most important difference is that your HSA balances can roll over from year to year and continue to grow tax-deferred.

Money in your flex plan must be spent by the end of the plan year or you lose it. That may sound like a big negative, but flex plans can save you a lot of money even if you don't spend every nickel. Also, you can open a flexible-spending account only if the plan is offered by your employer, and you don't need to have a high-deductible health insurance policy.