Skip to main content
capitalgaintaxcalc.com

Tax guide

Capital Gains in an IRA or 401(k): When Taxed? (2026)

Updated 2026-10-12 · Educational only. Not tax advice.

A gain inside an IRA or 401(k) is not taxed as a capital gain. A qualified Roth withdrawal is tax-free. A traditional withdrawal is taxed as ordinary income. Buying and selling stocks, ETFs, or funds inside the account does not create a current capital-gains tax bill. An early traditional distribution can also draw a penalty.

That is the opposite of a taxable brokerage account, where each sale can be a Form 8949 event with short-term or long-term rates, NIIT, and state tax. Tax-loss harvesting and wash sales are brokerage-account concepts; they do not create a deductible capital loss inside the IRA the way a taxable sale can.

When capital gains still matter

If you do a Roth conversion, the converted amount is generally taxed as ordinary income, not as a long-term capital gain, even if the IRA holds appreciated shares. After-tax basis in an IRA can change the taxable portion of a distribution.

Use the capital gains calculator for taxable account sales, not for IRA rebalancing. If you are comparing “sell in my 401(k)” vs “sell in my brokerage,” the brokerage sale is the one that needs holding period, basis, and state inputs.

FAQ

Frequently asked questions

If my IRA stock doubles, do I owe 15% LTCG when I rebalance?

Generally no, as long as the trade stays inside the IRA. You do not report each IRA trade as a capital gain on Schedule D.

Can I harvest a loss inside my 401(k)?

A drop in value inside the plan does not give you a current Schedule D capital loss. Harvesting losses for a deduction is a taxable-account strategy.

Guides