529 plans use LIFO (Last In, First Out) ordering for withdrawals, not FIFO
When you withdraw money from a 529 plan, the IRS treats it as if you're taking out your most recent contributions first, then earlier ones. This is called LIFO ordering. It matters because contributions and earnings are taxed differently — contributions came from money you already paid taxes on, but earnings haven't been taxed yet. LIFO means you pull out earnings before you pull out your original contributions, which affects how much tax you owe on each withdrawal.
The rule applies to non-may have access to withdrawals — money you take out for something other than education expenses. If you withdraw for a may have access to education expense (tuition, room and board, books, required equipment), the tax treatment is different and more favorable. But the order in which money leaves the account is still LIFO.
Key Takeaways
- 529 plans use LIFO ordering, meaning your most recent deposits are treated as withdrawn first, regardless of which money actually leaves the account.
- This matters only for non-may have access to withdrawals, where you owe income tax and a 10% penalty on the earnings portion.
- Contributions (your original deposits) come out tax-free; only the earnings portion is taxed and penalized in a non-may have access to withdrawal.
- If you withdraw for a may have access to education expense, LIFO ordering still applies, but the earnings come out tax-free and penalty-free.
Why LIFO matters: the tax difference between contributions and earnings
A 529 plan holds two types of money: your contributions (the deposits you made) and the earnings (investment growth). When you opened the account and added money, you used after-tax dollars — you already paid income tax on that money. The earnings, however, have never been taxed.
Under LIFO, a non-may have access to withdrawal pulls earnings out first. That means the earnings portion is subject to income tax plus a 10% federal penalty. Your contributions come out after the earnings are exhausted, and those come out tax-free because you already paid tax on them. If you had FIFO ordering instead, you'd pull out contributions first, which would delay the tax hit — but the IRS chose LIFO to discourage non-may have access to withdrawals.
How LIFO ordering works in practice
Suppose you opened a 529 plan and made three deposits: $5,000 in year one, $5,000 in year two, and $5,000 in year three. The account grew to $18,000 total — your $15,000 in contributions plus $3,000 in earnings. Now you withdraw $8,000 for a non-may have access to reason.
Under LIFO, the withdrawal is treated as coming from your most recent contribution first. The $5,000 from year three comes out first (all contributions, no tax). The next $3,000 comes from the year-two contribution (all contributions, no tax). That accounts for $8,000. The earnings stay in the account untouched in this scenario. If you had withdrawn $16,000 instead, the first $10,000 would be contributions (years three and two, tax-free), and the remaining $6,000 would be earnings (taxable and penalized).
The actual money doesn't move in this order — your brokerage might liquidate shares in any sequence. But for tax purposes, the IRS treats it as LIFO.
LIFO applies differently to may have access to and non-may have access to withdrawals
For a may have access to withdrawal (education expenses at an accredited school), LIFO ordering still determines which money is treated as coming out first. But the tax result is completely different: both contributions and earnings come out tax-free and penalty-free. The LIFO order doesn't change the tax bill; it just determines the accounting.
For a non-may have access to withdrawal, LIFO ordering is the reason you owe tax and penalty on the earnings portion. The IRS assumes you're taking out the most recent money first, which is treated as contributions until the contributions run out, then earnings. This discourages people from using 529 plans as general savings accounts.
There is one exception: if you change the beneficiary to another family member, the withdrawal is treated as may have access to (no tax or penalty on earnings), even though it's technically a withdrawal from the original beneficiary's account. LIFO still applies to determine which money is treated as coming out, but again, no tax is owed.
What happens if you have multiple 529 accounts
LIFO ordering applies to each 529 plan separately, not across all your accounts combined. If you have one 529 for your child and another for your grandchild, each account tracks its own contributions and earnings. A withdrawal from the child's account uses LIFO within that account only.
However, if you have multiple 529 accounts for the same beneficiary (the same child), the IRS treats them as a single account for tax purposes. A withdrawal from one account is combined with withdrawals from the other accounts when calculating how much is contributions versus earnings. This can matter if you're trying to withdraw only contributions and avoid the tax on earnings — you can't do it by choosing which account to withdraw from; the IRS aggregates them.
The 10% penalty on earnings in non-may have access to withdrawals
When you take a non-may have access to withdrawal, the earnings portion is subject to both income tax (at your regular tax rate) and a 10% federal penalty. Some states also add state income tax. The penalty is calculated only on the earnings, not on your contributions.
Using the earlier example: if you withdrew $16,000 from an account with $15,000 in contributions and $3,000 in earnings, the $6,000 of earnings would be taxed at your income tax rate plus 10%. If you're in the 22% federal bracket, you'd owe roughly 32% of the $6,000 in tax and penalty — about $1,920. Your $10,000 in contributions would come out untouched.
There are a few exceptions to the 10% penalty (not the income tax): if the beneficiary receives a scholarship, dies, or becomes disabled, the penalty is waived on the earnings portion. The earnings are still taxable income, but the 10% penalty does not apply.
Frequently Asked Questions
Can I choose which contributions to withdraw first to avoid the penalty?
No. LIFO ordering is mandatory — you cannot choose FIFO or any other method. The IRS treats your most recent contributions as withdrawn first, regardless of which money your brokerage actually sends you. If you have multiple 529 accounts for the same beneficiary, they're combined for this calculation, so you can't avoid the earnings by withdrawing from a specific account.
Does LIFO apply to may have access to education withdrawals?
Yes, LIFO ordering applies to may have access to withdrawals too, but it doesn't change the tax result. Both contributions and earnings come out tax-free for may have access to expenses, so the order doesn't matter for your tax bill. The IRS still tracks which money is treated as coming out first; it just doesn't charge tax on any of it.
What counts as a may have access to education expense?
may have access to expenses include tuition, fees, books, supplies, equipment (like a computer), and room and board if the student is at least half-time at an accredited school. K-12 tuition (up to $35,000 per year) and up to $35,000 in student loan repayment also count. Anything else — living expenses off-campus, transportation, insurance — is non-may have access to.
If I withdraw for a scholarship, do I still owe tax on the earnings?
Yes, you owe income tax on the earnings portion, but the 10% penalty is waived. If the beneficiary receives a scholarship equal to the amount you withdraw, only the earnings are taxable; the contributions come out tax-free. The scholarship itself is not taxable to the student if it covers may have access to education expenses.
Can I roll a 529 withdrawal into another 529 plan to avoid the penalty?
No. Once you withdraw money from a 529 plan for a non-may have access to reason, the tax and penalty apply. Rolling it into another 529 plan doesn't undo the withdrawal or the tax consequences. However, you can change the beneficiary to another family member without triggering tax or penalty, which is different from a withdrawal.