Skip Navigation
Home / borrowing / What Happens When You Sell From a Retirement Account?

borrowing

Jul 16, 2021

What Happens When You Sell From a Retirement Account?

You may owe taxes and penalties on your holdings.

By Stash Team
Last updated June 9, 2026

Selling an investment inside a retirement account is not the same as taking money out of that account. That difference matters.

If you sell a stock, ETF, or mutual fund inside a The Stash Way: Invest Regularly, or a traditional IRA, you usually do not owe capital gains tax just because you sold. The tax issue usually starts when money leaves the retirement account as a withdrawal, also called a distribution.

That is the core rule: selling inside the account is typically a portfolio move. Withdrawing from the account is typically a tax event.

All investing involves risk, and you can lose money with your investments. Investment gains are never promised.

What happens if you sell investments inside a retirement account?

In most retirement accounts, you can sell investments and keep the proceeds inside the account without triggering taxes right away.

For example, say you have $10,000 invested in an ETF inside a traditional IRA. You sell it and leave the $10,000 as cash in the IRA while you decide what to buy next. In that case, you generally do not report a taxable gain from that sale. The money stayed inside the IRA.

The same idea generally applies to employer-sponsored plans like 401(k)s and 403(b)s. If you exchange one fund for another inside the plan, that sale usually does not create a taxable event.

That is one of the main benefits of tax-advantaged retirement accounts: investments can be bought and sold inside the account without annual capital gains taxes in the way they might apply in a taxable brokerage account.

What happens if you sell and then withdraw the money?

This is where the rules change.

If you sell investments in a traditional IRA, 401(k), or 403(b), then take the cash out before age 59½, the withdrawal is usually treated as ordinary income. You may also owe a 10% early-withdrawal penalty unless an exception applies.

Here is a plain-English example.

Say you are 45 and withdraw $10,000 from a traditional IRA after selling investments. If you are in the 22% federal tax bracket, you could owe about $2,200 in federal income tax, plus a $1,000 early-withdrawal penalty. That is $3,200 before any state taxes. Your exact tax bill depends on your full income, filing status, and state rules.

That is why retirement-account withdrawals can feel more expensive than expected. You are not just spending the $10,000. You may also be giving up part of it to taxes and penalties, plus losing the chance for that money to stay invested for later.

Selling vs. withdrawing: the simple rule

Think of a retirement account like a fenced garden.

You can move plants around inside the fence. You can swap one plant for another. You can leave a patch empty for a while. That is like selling and reinvesting inside the account.

But once you take plants outside the fence, different rules apply. That is like taking a withdrawal.

In a retirement account, the fence is the account itself. As long as the money stays inside, selling is usually not the taxable part. Taking money out often is.

What about Roth accounts?

Roth accounts work differently because they are funded with after-tax dollars.

For a Roth IRA, you can generally withdraw your direct contributions at any time without taxes or penalties. That is because you already paid tax on that money before contributing it.

Earnings are different. To withdraw Roth IRA earnings tax- and penalty-free, the distribution generally must be qualified. That usually means:

  • You have satisfied the Roth IRA five-year holding period, and

  • You are at least age 59½, disabled, using the qualified first-time homebuyer exception, or the distribution is made to your beneficiary after your death.

Roth IRAs also have ordering rules. Withdrawals are generally treated as coming from contributions first, then conversions, then earnings. That can make Roth IRAs more flexible than many people realize.

Roth 401(k)s can be less flexible. Withdrawals from a Roth 401(k) may include both contributions and earnings on a pro-rata basis unless you roll the account to a Roth IRA and follow the applicable rules. If you are considering this, it is worth getting tax guidance before you move money.

Are there exceptions to the 10% early-withdrawal penalty?

Yes. The IRS allows some exceptions to the 10% early-distribution penalty. You may still owe ordinary income tax on the withdrawal, but the extra penalty may not apply.

Common exceptions can include:

  • Permanent and total disability

  • Certain unreimbursed medical expenses that exceed 7.5% of your adjusted gross income

  • Distributions to beneficiaries after the account owner’s death

  • A series of substantially equal periodic payments

  • Certain qualified higher education expenses from an IRA

  • Up to $10,000 for a qualified first-time home purchase from an IRA

  • Up to $5,000 for a qualified birth or adoption distribution

  • Certain emergency personal expense distributions, generally up to $1,000 per year

  • Certain domestic abuse victim distributions, subject to IRS limits

  • Separation from service in or after the year you turn 55 for certain workplace plans, or age 50 for some qualified public safety employees

The details matter. Some exceptions apply to IRAs but not 401(k)s. Some apply to workplace plans but not IRAs. IRS rules can also require documentation. You can review IRS information here and here, or speak with a qualified tax professional.

What if you close the whole retirement account?

Closing a retirement account can create a large tax bill if you take the money as cash.

If you close a traditional IRA or old 401(k) and receive the money personally, the full taxable amount may be included in your income for the year. If you are under age 59½, the 10% early-withdrawal penalty may also apply unless you qualify for an exception.

With a workplace plan like a 401(k), a cash distribution paid to you may be subject to mandatory 20% federal withholding. That withholding is not necessarily your final tax bill. You could owe more or get some back when you file, depending on your situation.

If your real goal is to move the account, not spend the money, consider a rollover instead.

Rollovers: moving money without cashing out

A rollover lets you move retirement money from one eligible account to another, such as from an old 401(k) to an IRA, or from one IRA provider to another. When done correctly, a rollover is generally not treated as a taxable withdrawal.

A direct rollover is often the cleanest option. The money moves from one financial institution to another, and you do not personally receive the cash.

An indirect rollover is riskier. If the money is paid to you, you generally have 60 days to deposit it into another eligible retirement account. If you miss the deadline, the IRS may treat it as a taxable distribution. If you are under age 59½, the 10% penalty may apply too.

Do required minimum distributions change the answer?

Yes, later in life.

Traditional IRAs and most workplace retirement plans are subject to required minimum distributions, or RMDs. As of 2026, RMDs generally begin at age 73 for many retirees. Under current law, the starting age is scheduled to rise to 75 for people who reach that age in 2033 or later.

RMDs are withdrawals, not just sales inside the account. You may sell investments to raise cash for an RMD, but the taxable event is the distribution leaving the account.

Roth IRAs do not require RMDs for the original account owner. Roth 401(k)s are also no longer subject to lifetime RMDs for the account owner under current federal law.

The Stash point of view

The retirement system makes a simple question sound complicated. It should not take a finance degree to know whether clicking sell creates a tax bill.

Here is our view: selling inside a retirement account can be a normal part of managing your portfolio. Pulling money out early is a much bigger decision.

Sometimes life forces hard choices. But retirement money is meant for later. Taking it early can mean taxes, penalties, and less invested for your future self. Before you withdraw, consider whether you have other options, such as using emergency savings, reducing near-term expenses, asking about a workplace-plan loan if available, or rolling over an old account instead of cashing it out.

The Stash Way is simple: invest consistently, diversify, and invest for the long term. You do not need to chase hot stocks or trade every headline. You need a plan you can stick with, plus guidance that does not feel locked behind a velvet rope.

You can learn more about how retirement accounts compare here: Stash Learn.

Frequently asked questions

Do I pay taxes when I sell stock in my IRA?

Usually, no. If you sell stock inside a traditional IRA or Roth IRA and keep the money in the account, the sale itself generally does not trigger capital gains tax. Taxes may apply when you withdraw money, depending on the account type and withdrawal rules.

Do I pay taxes when I sell investments in my 401(k)?

Usually, no. Selling or exchanging funds inside a 401(k) generally does not create a taxable event. Taking money out of the 401(k) is the part that may trigger ordinary income tax and, if you are under age 59½, a possible 10% penalty.

Can I sell in a Roth IRA without penalty?

Yes, selling investments inside a Roth IRA generally does not create a tax or penalty. Withdrawing money is different. Roth IRA contributions can generally be withdrawn anytime, but earnings may be taxed and penalized if the withdrawal is not qualified.

What happens if I withdraw from a retirement account before age 59½?

For traditional retirement accounts, the withdrawal is generally taxed as ordinary income and may face a 10% early-withdrawal penalty. Some IRS exceptions can remove the penalty, but income tax may still apply.

Is closing a retirement account the same as selling investments?

Not always. You might sell investments and keep the money inside the account, which usually is not taxable. But if you close the account and take the cash, that is usually a withdrawal. A rollover may let you move the money to another retirement account without treating it as a cash-out.

Should I sell retirement investments during a market drop?

Market drops are stressful, but selling because of panic can lock in losses and pull you away from your long-term plan. Rebalancing can make sense for some investors. Trying to time the market is much harder than it sounds. A diversified portfolio and a long-term plan are usually better tools than reacting to every swing.

Written by

Team Stash

We want to turn money into a source of hope and opportunity. We teach people how to build good habits, save more and make it easy and affordable to get started investing. So far, we’ve helped over 6 million people create a more secure financial future with our expert advice and award winning investing app.

1 For retirement, Stash offers access to traditional or Roth IRAs.
2 Withdrawing from a traditional IRA prior to age 59½, generally means you’re subject to income tax and a 10% penalty. Withdrawals after age 59½ are only subject to income tax but no penalty.
3 Withdrawals from a Roth IRA, money (Contributions) you put in are penalty and tax free. Prior to age 59½, withdrawals of interest and earnings are subject to income tax and a 10% penalty. All earnings are tax free at age 59½ or older, assuming your first contribution was more than 5 years prior. Income Eligibility applies.
This should not be construed as tax advice. Please consult a tax professional for additional questions.