Withdrawals from a 401k are not subject to capital gains tax. The IRS treats every dollar you pull out of a traditional 401k as ordinary income taxed at your regular federal rate, whether the money represents your original contributions or decades of investment growth. One narrow exception exists for employer stock, and Roth 401k accounts follow a different set of rules. So when people ask about capital gains tax on 401k withdrawals, the short answer is that the 0%, 15%, and 20% long-term capital gains rates you see quoted for brokerage accounts simply don’t apply here.
Why Gains Inside a 401k Escape Capital Gains Tax
In a regular brokerage account, selling a stock or fund for a profit triggers capital gains tax that year. Long-term gains on assets held over a year face rates of 0%, 15%, or 20% depending on income, and short-term gains are taxed as ordinary income.1Internal Revenue Service. Topic No. 409, Capital Gains and Losses
A 401k works differently. The trust holding your 401k assets is exempt from federal income tax under the tax code, so buying, selling, and rebalancing inside the account produces no taxable event.2Office of the Law Revision Counsel. 26 USC 501 – Exemption From Tax on Corporations, Certain Trusts, Etc. You can swap funds or take profits without owing anything at the time. That tax-exempt wrapper is what powers long-term compounding inside the plan. The government collects later, under different rules, when money actually leaves the account.
How Traditional 401k Withdrawals Are Taxed
When you withdraw from a traditional 401k, the full amount counts as ordinary income for that tax year.3Office of the Law Revision Counsel. 26 USC 72 – Annuities; Certain Proceeds of Endowment and Life Insurance Contracts The IRS makes no distinction between your original pre-tax contributions and the earnings those contributions produced. A $10,000 withdrawal adds $10,000 to your taxable income, and that’s the end of the analysis.
For 2026, federal income tax rates run from 10% on the first $12,400 of taxable income for single filers up to 37% on income above $640,600.4Internal Revenue Service. Tax Inflation Adjustments for Tax Year 2026 Your 401k distributions stack on top of any other income you receive that year, including Social Security, pensions, and part-time earnings. A retiree in the 22% bracket who takes a $10,000 distribution pays $2,200 in federal tax on it, regardless of whether that money came from contributions made thirty years ago or from last year’s market gains.
This is often a worse result than capital gains treatment. If the same investments had lived in a taxable account and been sold after a year, the profit would likely have been taxed at the 15% long-term rate rather than your ordinary income rate. The benefit of the 401k is the tax-deferred compounding along the way, not the rate applied at the end.
Roth 401k Withdrawals Follow Their Own Rules
A Roth 401k inverts the traditional structure. Contributions go in after tax, and qualified withdrawals come out entirely tax-free, including all investment growth.5Office of the Law Revision Counsel. 26 USC 402A – Optional Treatment of Elective Deferrals as Roth Contributions No ordinary income tax on the earnings, and no capital gains tax either.
Two conditions must be met for tax-free treatment. You must be at least 59½, and you must have held the Roth 401k for at least five tax years, measured from January 1 of the year of your first Roth contribution under that employer’s plan.5Office of the Law Revision Counsel. 26 USC 402A – Optional Treatment of Elective Deferrals as Roth Contributions Contribute first in March 2022, and the account clears the holding requirement on January 1, 2027.
Miss either condition and only your original contributions come out tax-free; the earnings portion becomes ordinary income and may face the 10% early withdrawal penalty. For 2026, the combined employee contribution limit for traditional and Roth 401k accounts is $24,500, with an additional $8,000 catch-up for those 50 and older and $11,250 for those aged 60 through 63.6Internal Revenue Service. 401(k) Limit Increases to $24,500 for 2026, IRA Limit Increases to $7,5007Internal Revenue Service. 2026 Amounts Relating to Retirement Plans and IRAs, as Adjusted for Changes in Cost-of-Living
The One Exception: Net Unrealized Appreciation on Employer Stock
There is one scenario where growth inside a 401k can be taxed at capital gains rates, and it applies only to employer stock. The tax code allows a treatment called net unrealized appreciation, or NUA, when you take a lump-sum distribution that includes shares of your employer’s stock.8Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees’ Trust
Rather than rolling the whole balance into an IRA, you transfer the employer stock into a taxable brokerage account and roll the rest into an IRA. The plan’s original cost basis for the stock is taxed immediately as ordinary income. The appreciation that built up while the stock sat inside the 401k is not taxed until you sell those shares, and when you do, that appreciation qualifies for long-term capital gains rates no matter how long you have held the shares after the distribution.8Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees’ Trust
The math can be significant. Say your employer stock has a cost basis of $20,000 and is now worth $120,000. A normal distribution would add the full $120,000 to your ordinary income. With NUA, you pay ordinary income tax on the $20,000 basis and long-term capital gains rates on the $100,000 of appreciation when you sell. At a 24% income rate and a 15% capital gains rate, that saves over $9,000 in federal tax on this example alone.
The requirements are strict. You must take a lump-sum distribution of your entire balance from all of the employer’s plans of the same type within a single tax year, and the distribution must follow one of four triggering events: separation from service, reaching age 59½, disability for self-employed individuals, or death.8Office of the Law Revision Counsel. 26 USC 402 – Taxability of Beneficiary of Employees’ Trust Any further gain after the stock leaves the plan is taxed at short-term or long-term capital gains rates based on how long you hold the shares from the distribution date. The strategy is worth pursuing only if the NUA represents a large share of the stock’s total value. When the cost basis is close to the market price, there is little to gain.
State Taxes Are a Separate Question
Federal treatment is only half the picture. Most states impose their own income tax on 401k withdrawals, with rates ranging from zero in no-income-tax states to over 13% in the highest-tax states. Several states exempt some or all retirement income for older residents, and the rules vary widely. A $50,000 distribution could owe nothing in state tax or several thousand dollars depending on where you live. Checking your state’s treatment of retirement income before you start taking distributions is worth the effort.