Do You Pay Taxes When You Sell Stock in an IRA?

Selling a stock inside a Traditional or Roth IRA does not trigger any tax. The IRS treats buys and sells within the account as internal activity, so gains, losses, and rebalancing moves never hit your tax return as long as the money stays in the IRA. You only owe taxes when you pull money out, and how much depends on which type of IRA you have and how old you are at the time.

Why the Sale Itself Isn’t Taxed

In a regular brokerage account, every profitable sale creates a capital gain you report that year. Short-term gains get taxed at ordinary income rates, long-term gains get a lower rate, and you track all of it on Schedule D and Form 8949.1Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets

None of that applies inside an IRA. The account is a tax-sheltered wrapper, and the IRS only pays attention to money going in (contributions) and money coming out (distributions). You can sell a stock for a $50,000 gain, reinvest the full amount the same day, and report nothing. No capital gains tax, no holding-period distinction, no reporting forms for the trade. This is the central advantage of a retirement account, and it compounds over decades because every dollar stays invested instead of being skimmed each year.

Your IRA custodian will not issue a Form 1099-B for trades inside the account. That form reports sale proceeds to the IRS, and the instructions specifically exempt IRAs from the reporting requirement.2Internal Revenue Service. Instructions for Form 1099-B (2026) If you sold a dozen different stocks inside your IRA last year, none of them appear on your return.

When a Traditional IRA Withdrawal Gets Taxed

The trade-off for tax-free growth in a Traditional IRA is that nearly every dollar you withdraw is taxed as ordinary income. Your contributions were deducted from your taxable income the year you made them, so the IRS collects when the money comes back out. The withdrawal lands on your return the same way wages do, taxed at whatever marginal bracket you fall into that year.

If you take the money out before age 59½, the IRS adds a 10% early withdrawal penalty on top of the ordinary income tax.3Internal Revenue Service. Retirement Topics – Exceptions to Tax on Early Distributions

If You Made Nondeductible Contributions

Not every Traditional IRA contribution is deductible. If your income is above certain thresholds and you or your spouse participate in a workplace retirement plan, your deduction phases out. When you contribute without taking a deduction, you have already paid tax on that money, and you shouldn’t pay again on the way out.

The IRS uses a pro-rata rule to figure the taxable portion of each withdrawal. You cannot pull out your after-tax dollars first. Every distribution is treated as a proportional mix of pre-tax and after-tax funds, based on the ratio of your total nondeductible contributions (your “basis”) to the combined value of all your Traditional IRAs.4Internal Revenue Service. Instructions for Form 8606 – Nondeductible IRAs

You track basis on Form 8606, filed with your return in any year you make a nondeductible contribution or take a distribution from an IRA that holds after-tax money. Failing to file it carries a $50 penalty, but the bigger risk is losing your records and getting taxed twice on the same money. Keep every Form 8606 you have ever filed.

When a Roth IRA Withdrawal Gets Taxed

Roth IRAs flip the model. You contribute after-tax dollars, get no deduction, and qualified withdrawals come out completely tax-free, including the growth. The key word is “qualified.”

The IRS applies a specific order when you take money out of a Roth. You must exhaust each category before moving to the next:5Internal Revenue Service. Publication 590-B, Distributions From Individual Retirement Arrangements

  • Regular contributions come out first, tax-free and penalty-free at any time, at any age, for any reason.
  • Conversion and rollover amounts come out next on a first-in, first-out basis. If you withdraw conversion amounts within five years of that specific conversion and you are under 59½, the 10% penalty may apply to the taxable portion.
  • Earnings come out last, and this is where the rules tighten.

Earnings come out tax-free and penalty-free only if the distribution is qualified. Two conditions must both be met: at least five tax years have passed since you first contributed to any Roth IRA, and the withdrawal is triggered by reaching 59½, becoming disabled, death (for beneficiaries), or a first-time home purchase up to $10,000.6GovInfo. 26 USC 408A – Roth IRAs Fail either condition and the earnings portion is taxed as ordinary income plus the 10% penalty. The ordering rules protect you to a point, since you have to withdraw more than your total contributions before touching earnings at all.

Exceptions to the 10% Early Withdrawal Penalty

The 10% additional tax on distributions before 59½ applies to both Traditional and Roth IRAs (on the taxable portion). Several exceptions waive the penalty, though for a Traditional IRA the ordinary income tax still applies even when the penalty is waived.3Internal Revenue Service. Retirement Topics – Exceptions to Tax on Early Distributions The ones people use most:

  • Unreimbursed medical expenses exceeding 7.5% of your adjusted gross income.
  • Qualified higher education costs for you, your spouse, children, or grandchildren. IRA-only, not available for employer plans.
  • First-time home purchase, up to $10,000 over your lifetime. Also IRA-only.
  • Substantially equal periodic payments based on your life expectancy, taken at least annually. Once started, you must continue for five years or until you reach 59½, whichever comes later.
  • Amounts seized by the IRS to satisfy a tax debt.

Other exceptions cover permanent disability, qualified birth or adoption expenses, and distributions to terminally ill individuals. Congress has added narrower carve-outs over time, so if your situation is unusual, check current IRS guidance before assuming the penalty applies.

The Wash Sale Trap Between Your Brokerage and Your IRA

Tax-free trading inside an IRA can backfire if you don’t coordinate with your taxable brokerage account. The scenario catches people regularly: you sell a stock at a loss in your taxable account, intending to claim the capital loss on your return, and within 30 days you buy the same stock inside your IRA.

The IRS treats this as a wash sale. In a normal wash sale, the disallowed loss gets added to the cost basis of the replacement shares, so you recover it eventually. When the replacement sits inside an IRA, the loss is permanently gone, because IRAs don’t track individual cost basis for tax purposes. The IRS confirmed this position in Revenue Ruling 2008-5, and it applies to Traditional and Roth IRAs alike. The 30-day window runs both directions: a purchase inside your IRA within 30 days before or after the taxable sale triggers the same result.

If you harvest losses in a brokerage account, make sure you are not simultaneously buying the same or substantially identical securities in your retirement accounts.

You May Have to Sell Stock to Take a Required Distribution

Traditional IRA owners cannot defer taxes forever. The IRS requires annual withdrawals, called required minimum distributions, starting at a certain age. If you were born between 1951 and 1959, RMDs begin at 73. If you were born in 1960 or later, the starting age is 75.7Congress.gov. Required Minimum Distribution (RMD) Rules for Original Owners

Your first RMD can be delayed until April 1 of the year after you turn 73 (or 75). Every one after that is due by December 31. Delaying the first one means two distributions in the same calendar year, which can push you into a higher bracket.8Internal Revenue Service. Retirement Topics – Required Minimum Distributions (RMDs) Missing an RMD or taking less than required triggers a 25% excise tax on the shortfall, dropping to 10% if you correct it within two years.9Internal Revenue Service. Retirement Plan and IRA Required Minimum Distributions FAQs

This is where the tax-free trading rule becomes practically useful. To raise cash for an RMD, you may need to sell stock inside the account. That sale is still tax-free. Only the distribution itself is taxed, as ordinary income, when the cash leaves the IRA.

Roth IRAs have no RMDs during the original owner’s lifetime, so a Roth owner can leave stock sitting in the account indefinitely without ever being forced to sell.

Withholding When You Do Take Money Out

When you take a Traditional IRA distribution, your custodian withholds 10% for federal income tax by default. You can change the rate (from 0% to 100%) by filing Form W-4R with the custodian.10Internal Revenue Service. Pensions and Annuity Withholding Choosing 0% doesn’t eliminate the tax; it just means you owe the full amount when you file. For a large distribution, you may need to make estimated payments to avoid an underpayment penalty. State income tax may apply on top, depending on where you live.

The custodian reports the distribution on Form 1099-R, which shows the gross amount, the taxable portion, and a code explaining why the money came out. Code 1 flags an early distribution with no known exception; Code 7 is a normal distribution after 59½. If you qualify for a penalty exception but your 1099-R shows Code 1, you claim the exception yourself on Form 5329.11Internal Revenue Service. About Form 1099-R, Distributions From Pensions, Annuities, Retirement or Profit-Sharing Plans, IRAs, Insurance Contracts, etc.

None of these forms report the stock sale that produced the cash. The sale happened inside the wrapper, and the IRS doesn’t see it.