You can make a tax-free rollover into an HSA from an IRA, but not from a 401(k), 457, or another retirement plan. However, if you have a 401(k) from a former employer, you may be able to make the move in two steps: Roll it over into an IRA first, then make a tax-free direct transfer from the IRA into your HSA.
You can then use the money in the HSA tax-free for medical expenses in any year. If you take money out of a traditional IRA to pay medical expenses (or anything else), you’ll have to pay taxes on the withdrawal and may have to pay a 10 percent penalty if you’re under 59½ (you can make penalty-free IRA withdrawals for medical expenses that are more than 10 percent of your adjusted gross income for the year, or more than 7.5 percent if you are 65 or older).
There are a few caveats: You can make a tax-free rollover from an IRA to an HSA only once in your lifetime, and you must qualify to make new HSA contributions that year (in 2020, you must have a health insurance policy with a deductible of at least $1,400 for individual coverage or $2,800 for family coverage). The size of the rollover is limited to the annual HSA contribution limit minus any money you’ve already contributed for the year. In 2020, you can contribute up to $3,550 to an HSA if you have individual coverage or $7,100 for family coverage, plus an extra $1,000 if you’re 55 or older anytime during the year. Contact your IRA and HSA administrator about making a direct transfer from one account to the other.
If you have the extra cash, it is usually better to use new money for HSA contributions. That way, you can keep more money growing tax-deferred in your IRA and take a tax deduction for new HSA contributions.