Yes1. You can make a once in a lifetime transfer from an IRA to an HSA.
The transferred IRA amount + any HSA contributions for that year can’t exceed the annual contribution maximum2. In other words, your IRA transfer counts towards your annual HSA contribution limit. This also means you must be covered under an HSA eligible health plan when doing this. Please see more information below.
Please note that there is a special testing period for this kind of qualified funding distribution. The testing period is from the month you are eligible and contributed until the end of the months 12 months from then. You can contribute up to the total amount of the contribution limit for the year.
For example – you contribute to your HSA on June 13, 2018. You must be eligible to contribute to an HSA from June 1 2018-June 30, 2019.
There is also the last month rule, which says if you are covered December 1 of a given year you can contribute for the whole year provided you remain eligible to contribute to an HSA through December of the following year.
Both methods basically test for allowing a maximum contribution without potentially being eligible for the full year but for the last-month rule, the test always starts December 1.
Please be sure to consult with your tax professional. If it is not done properly, it can result in taxes and IRS penalties.
1: IRC Sec. 408(d)(9)
2: IRC Sec. 223(b)(4)(C)