Skip to main content
capitalgaintaxcalc.com

Tax guide

Do you pay capital gains tax in an IRA or 401(k)?

Updated 2026-08-18 · Educational only — not tax advice

Inside a traditional IRA or 401(k), buying and selling stocks, ETFs, or funds generally does not create a current capital-gains tax bill. The account is tax-deferred: you typically pay ordinary income tax on withdrawals later (and may owe a penalty on early distributions). Roth IRAs and designated Roth 401(k)s follow contribution and qualified-distribution rules instead of per-trade capital gains.

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