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.
