Tax-Free Withdrawals: Rules for Roth, HSA, and 529s

Withdrawals from a Roth IRA, a Health Savings Account, and a 529 plan can all come out completely free of federal income tax, but each account has its own qualification rules and its own penalties for getting them wrong. For a Roth IRA, your direct contributions are always yours to take back tax-free and penalty-free, while the investment earnings are tax-free only once you’ve held any Roth IRA for at least five tax years and hit a qualifying event such as turning 59½. For an HSA, withdrawals owe nothing when spent on qualified medical expenses. For a 529, withdrawals owe nothing when spent on qualified education expenses. Everything else can trigger income tax, a penalty, or both.

Roth IRA: Contributions Come Out First, Always

The most useful feature of a Roth IRA is also the one people miss most often: your direct contributions can be withdrawn at any time, at any age, without tax and without penalty. You already paid tax on that money before it went in, and the IRS does not tax it again on the way out. If you put in $30,000 over the years and the account has grown to $45,000, that first $30,000 is available to you whenever you want it.

The IRS enforces a specific ordering system for anything you pull out of a Roth IRA. Contributions come out first and are always tax-free and penalty-free. Conversions come out next, on a first-in, first-out basis by year, with taxable conversion amounts leaving before non-taxable ones. Earnings come out last, and that is where the qualified distribution rules matter.

Because of this ordering, many people who tap a Roth IRA before 59½ never actually touch earnings and pay nothing. Only after every contribution and conversion dollar has been distributed does the IRS treat you as dipping into growth.

When Roth IRA Earnings Are Tax-Free

Earnings escape federal tax only through what the code calls a qualified distribution, and that requires two conditions at the same time.1Office of the Law Revision Counsel. 26 USC 408A – Roth IRAs

First, the five-year clock must have run. It starts on January 1 of the tax year you made your first contribution to any Roth IRA. A contribution made in March 2022 starts a clock that ends January 1, 2027. One clock covers all your Roth IRAs; opening a second account does not restart it.

Second, you must hit one of these triggers:

Miss either the five-year rule or the trigger, and the earnings portion becomes ordinary income. Add a 10% early distribution penalty on top if you are under 59½.3Internal Revenue Service. Topic No. 557, Additional Tax on Early Distributions From Traditional and Roth IRAs

Conversions Run Their Own Five-Year Clock

Rolling money from a traditional IRA or 401(k) into a Roth IRA starts a separate five-year holding period for that converted amount. This clock is independent of the contribution clock, and each conversion starts its own. Convert in 2023 and again in 2025, and you are tracking two clocks.

If you are under 59½ and pull converted pre-tax dollars before the five years are up, you owe the 10% early distribution penalty on that amount.4Internal Revenue Service. Retirement Topics – Exceptions to Tax on Early Distributions You will not owe income tax again on the converted amount, because you paid that at conversion, but the penalty applies. Once you pass 59½, the conversion five-year rule stops mattering for penalty purposes.

Anyone running a series of conversions in their 40s or 50s as a bridge to retirement needs to track each conversion year. Ordering rules distribute conversions first-in, first-out, so the oldest conversion clears its window first.

Penalty Exceptions Before 59½

Several exceptions eliminate the 10% early distribution penalty, though they do not automatically make the earnings tax-free. For earnings to escape both the penalty and income tax, you still need a qualified distribution.4Internal Revenue Service. Retirement Topics – Exceptions to Tax on Early Distributions

  • First-time home purchase, up to $10,000 lifetime, provided you have not owned a principal residence in the past two years.2Office of the Law Revision Counsel. 26 USC 72 – Annuities; Certain Proceeds of Endowment and Life Insurance Contracts
  • Birth or adoption, up to $5,000 per child for qualified expenses.
  • Unreimbursed medical expenses that exceed 7.5% of your adjusted gross income.
  • Higher education costs — tuition, fees, books, supplies, and room and board for at least half-time students — at eligible institutions, for you, your spouse, children, or grandchildren.
  • Health insurance premiums while unemployed, if you received unemployment compensation for at least 12 consecutive weeks.
  • Substantially equal periodic payments calculated on your life expectancy, sometimes called a 72(t) distribution.
  • Permanent disability or death, which eliminates the penalty and, if the five-year rule is met, the income tax on earnings too.

HSA: Tax-Free Only for Qualified Medical Expenses

Health Savings Accounts carry a rare triple tax advantage: contributions are deductible, growth is tax-free, and withdrawals for qualified medical expenses owe nothing.5Office of the Law Revision Counsel. 26 USC 223 – Health Savings Accounts No other account in the tax code offers all three. You must be enrolled in a high-deductible health plan to contribute.

Qualified medical expenses include doctor visits, prescription drugs, dental care, vision costs, and certain long-term care services. Use HSA funds for anything else and you owe income tax on the withdrawal plus a 20% penalty. The penalty disappears at age 65 or on becoming disabled, but ordinary income tax still applies to non-medical withdrawals after that age. A few states, including California, do not follow the federal treatment and tax HSA contributions or earnings at the state level.

529 Plan: Tax-Free Only for Qualified Education Expenses

Withdrawals from a 529 plan are tax-free when spent on qualified education expenses.6Office of the Law Revision Counsel. 26 USC 529 – Qualified Tuition Programs There is no federal deduction going in, though many states offer one, and investment growth is never taxed if spent on eligible costs.

Qualified expenses cover:

  • College and graduate school tuition, fees, books, supplies, equipment, and room and board at eligible postsecondary institutions.
  • K-12 tuition of up to $10,000 per year at public, private, or religious elementary and secondary schools.7Internal Revenue Service. 529 Plans: Questions and Answers
  • Registered apprenticeship program fees, textbooks, supplies, and required equipment, for programs registered with the U.S. Department of Labor.
  • Student loan repayment, up to $10,000 lifetime per beneficiary, including for siblings of the beneficiary.

Use 529 money for anything outside these categories and the earnings portion gets hit with income tax plus a 10% penalty. Your original contributions come back without penalty, because they went in with after-tax dollars.

Rolling Leftover 529 Funds Into a Roth IRA

The SECURE 2.0 Act opened a new option when a 529 has money left over: you can roll it into a Roth IRA for the same beneficiary, within limits. The 529 must have been open for at least 15 years. Any contribution being transferred must have sat in the account for at least five years. The beneficiary needs earned income equal to or greater than the transfer, and each year’s transfer counts against the annual Roth IRA contribution limit. The lifetime cap is $35,000 per beneficiary. Roth IRA income limits are waived for these transfers, which makes this useful when a child earns a scholarship or decides not to attend college.

Inherited Roth IRAs

A Roth IRA can pass tax-free income to heirs, but the rules split by relationship. A surviving spouse can treat the inherited Roth as their own, roll it into an existing Roth IRA, and follow the standard rules.

A non-spouse who inherited a Roth from someone who died after 2019 generally must empty the account by the end of the 10th year following the owner’s death. If the original owner had already satisfied the five-year rule, every dollar coming out is tax-free, earnings included, and you do not need to be 59½ yourself. If the original owner had not met the five-year rule, contributions and conversions still come out tax-free, but earnings withdrawn before the five-year mark are taxable.1Office of the Law Revision Counsel. 26 USC 408A – Roth IRAs

Reporting a Tax-Free Withdrawal

Tax-free is not invisible. You still have to report these distributions, and your financial institution will send a Form 1099-R for each Roth withdrawal. The important detail is the distribution code in Box 7. Code Q signals a qualified Roth IRA distribution, telling you and the IRS the five-year rule and age requirements were met.8Internal Revenue Service. Instructions for Forms 1099-R and 5498 – Section: Box 7, Distribution Codes If the 1099-R shows a different code, you may need to demonstrate on your return that the withdrawal still qualifies.

On Form 1040, IRA distributions go on lines 4a and 4b, with the taxable amount on 4b. Employer plan distributions go on lines 5a and 5b.9Internal Revenue Service. Instructions for Form 1040 For a qualified Roth withdrawal, the taxable line reads zero. If a Roth IRA distribution was not fully qualified, file Form 8606, Part III, which applies the ordering rules and calculates any taxable portion.10Internal Revenue Service. Form 8606 – Nondeductible IRAs

HSA distributions go on Form 8889, which reports your contributions, deduction, and any taxable distributions for the year.11Internal Revenue Service. Instructions for Form 8889 Keep every receipt for medical expenses paid with HSA funds. The IRS will not ask when you file, but if the return is later reviewed, receipts are the only proof the withdrawal was qualified. The same is true for 529 plans: save tuition bills, bookstore receipts, and room and board invoices. No federal form is required when the 529 withdrawal is fully qualified, but the documentation is what protects the tax-free treatment if the IRS asks.