Last week, we talked about IRA-to-HSA rollovers, and scenarios in which they can be useful. If you're considering rolling money from your IRA to your HSA, there are several rules that you need to understand. Let's take a look at how this works:

You're limited to the annual contribution limit

You can't just take all the money in your IRA and move it over to your HSA. Total contributions to an HSA — including a rollover from your IRA — are capped by the IRS**.

So if you've got self-only coverage under an HDHP and you've already put $1,000 into your HSA for 2018, you could make a one-time transfer from your IRA to your HSA, but the most you could transfer would be $2,450 (the $3,450 annual limit, minus the $1,000 you already contributed).

The transfer has to be direct (to and from your own accounts)

You have to request that the money be transferred directly from your IRA to your HSA. It can't be sent from the IRA to you, for you to then deposit into the HSA. And, the account owner for the IRA and the HSA have to be the same person. IRAs and HSAs are both individual accounts, without joint ownership.

If you're married and have family HDHP coverage, you and your spouse can choose to just fund one HSA, instead of each having your own. The HSA can be used to pay for medical expenses for the whole family, but in one spouse's name. In that case, the other spouse cannot transfer funds from his or her IRA to the HSA.

You can't deduct the rollover

When you put money in your HSA, you don't have to pay taxes on it. The money is deducted from your paycheck before taxes if you contribute to an HSA through your employer, or you deduct it on the first page of your tax return if you make your own HSA contributions.

But if part of your contribution for the year is from a direct IRA rollover, you can't deduct that part. Let's say you have family HDHP coverage in 2018 and you contribute $3,000 to the HSA and then rollover another $3,900 from your IRA. You'd deduct the $3,000 contribution (assuming this contribution wasn't made through pre-tax salary reductions from pay, which could not also be deducted)) when you file your taxes, but not the $3,900.

It can be a Roth IRA or a traditional IRA

You can transfer money to your HSA from your Roth IRA or your traditional IRA. But keep in mind that you can withdraw your contributions (but not your earnings) from your Roth IRA at any time, for any reason, without taxes or a penalty. That's because your Roth IRA contributions were already taxed.

So the IRA-to-HSA transfer is generally more beneficial if you're transferring money from your traditional IRA to your HSA. If you were just withdrawing money from your traditional IRA, you'd pay taxes and a penalty on the full amount of the withdrawal, including both contributions and earnings.

If you have a Roth IRA and you want to move some of the money into your HSA instead, you can withdraw the amount you've contributed to the Roth, with no penalties or taxes. You could then deposit that money into your HSA, and take the tax deduction for the HSA contribution.

But if you want to withdraw Roth earnings (as opposed to contributions), using the direct IRA-to-HSA rollover will allow you to avoid the taxes and penalties. Also keep in mind -- for regular HSA contributions, you have until the due date for your tax return to make the contributions. But an IRA to HSA rollover is counted in the year you make the transfer.

You have to remain covered by an HDHP for another 12 months

You have to be covered by an HDHP in order to make a rollover from your IRA to your HSA. And you then have to stay covered by an HDHP for at least 12 more months after the transfer. If not, the money you transferred will be included in your taxable income, and you'll also owe a 10% penalty on the money you withdrew from your IRA.

This is different from the testing period rules that apply when you become HSA-eligible mid-year. If your HDHP coverage starts mid-year, the IRS will let you make the full HSA contribution for that year, but then you need to stay covered by an HDHP for the entire following calendar year. In the case of an IRA-to-HSA rollover, you just have to remain covered by an HDHP for 12 more months.

You can only do it once

Here's what we meant by "once in a lifetime." Transferring money from your IRA to your HSA is something you can only do once.

If you have multiple IRAs and you want to pull money from more than one IRA and move it to your HSA, you have to first transfer the money from one IRA to the other in order to consolidate it, and then initiate one transfer, for the total amount, directly to your HSA.

The exception to the once-in-a-lifetime rule is if you've got self-only HDHP coverage for the first part of the year, and family HDHP coverage for the second part of the year, since there are different contribution limits that apply in those two scenarios.

If you make an IRA to HSA transfer based on the self-only limit and then have family coverage later in the same year, you're allowed to make one more IRA to HSA rollover during that same year, based on the higher contribution limit that applies when you have family HDHP coverage.

As always, this column is intended to provide an outline of how the regulations work, but it can't substitute for personalized advice specific to your situation. If you're considering an IRA-to-HSA rollover, be sure to consult with a financial advisor.

Tax Facts is a weekly column offering straight up, no-nonsense HSA tax tips, written in everyday language. Look for it every Tuesday, exclusively on the HSAstore.com Learning Center. And for the latest info about your health and financial wellness, be sure to follow us on Facebook and Twitter

HSA updates, stories and deals, right in your inbox!