Capital Gains Tax in an IRA: Understanding Tax and the Self-Directed IRA

Capital Gains Tax in an IRA: Understanding Tax and the Self-Directed IRA

Adam Bergman

Founder, Tax Lawyer, Author

Every time you sell an investment for more than you paid, the IRS wants a share of the profit. Capital gains tax is one of the biggest drags on long-term returns, and it’s a big reason I’ve spent my career helping people invest through retirement accounts. Understanding how capital gains tax in an IRA works, and why it mostly doesn’t apply, can change where you decide to hold your investments, especially if you trade actively or buy real estate through a Self-Directed IRA.

Key Takeaways

  • Gains on assets held one year or less are taxed at ordinary income rates, which top out at 37% in 2026.
  • Long-term gains are taxed at 0%, 15%, or 20%, and most single filers with $49,451 to $545,500 of taxable income pay 15%.
  • Gains inside a traditional or Roth IRA aren’t taxed when realized, no matter how long you held the asset.
  • Traditional IRA withdrawals are taxed as ordinary income, while qualified Roth IRA withdrawals come out tax-free.
  • Debt-financed real estate and active business income can trigger UBTI inside an IRA, an exception many investors miss.

What Are Capital Assets?

According to the IRS, almost everything you own and use for personal or investment purposes is a capital asset, including your home, your car, and stocks or bonds held in a brokerage account. Under Internal Revenue Code Section 1221, a capital asset is essentially any property other than inventory, accounts receivable, and a handful of other narrow categories. When you hold capital assets inside an IRA, you get either tax-deferred growth or, in the case of a Roth IRA, tax-free growth and withdrawals.

Understanding Capital Gains Tax

Capital gains tax is the tax on the profit from selling an investment. The gain is generally the sale price minus your basis, which is usually what you paid plus certain costs. If you buy a stock for $5,000 and sell it for $8,000, you have a $3,000 capital gain.

Retirement accounts change this picture. A traditional IRA pays no capital gains tax while assets stay inside the account, and withdrawals are taxed as ordinary income. A Roth IRA is funded with after-tax dollars, so growth and qualified withdrawals avoid capital gains tax entirely.

Book a free call with a self-directed retirement specialist

  • Review your self-directed retirement options
  • Learn about investing in alternative assets
  • Get all of your questions answered

Connect with an Expert

Capital Gains Tax Rates for 2026

The rate you pay outside an IRA depends on how long you held the asset. If you held it one year or less, the gain is short-term and taxed at your ordinary income rate, which tops out at 37% for 2026. If you held it more than one year, the gain is long-term and taxed at 0%, 15%, or 20% depending on your taxable income.

2026 long-term rate

Single

Married filing jointly

Head of household

Married filing separately

0%

Up to $49,450

Up to $98,900

Up to $66,200

Up to $49,450

15%

$49,451 to $545,500

$98,901 to $613,700

$66,201 to $579,600

$49,451 to $306,850

20%

Over $545,500

Over $613,700

Over $579,600

Over $306,850

Source: IRS Revenue Procedure 2025-32. Thresholds are based on taxable income.

A few exceptions are worth knowing. Higher earners may owe an additional 3.8% net investment income tax under IRC Section 1411 once modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers. Gains on collectibles can be taxed at up to 28%, and the portion of a real estate gain tied to prior depreciation (unrecaptured Section 1250 gain) can be taxed at up to 25%. The IRS summarizes these rules in Topic No. 409, Capital Gains and Losses.

The holding period starts the day after you acquire the asset. If you bought an asset on August 1, 2025, your holding period began August 2, 2025. Selling on August 1, 2026 would produce a short-term gain, while selling on August 2, 2026 or later would produce a long-term gain. One day can be the difference between a 37% rate and a 20% rate. For more on how this plays out with property, see my post on Self-Directed IRA Real Estate vs. Capital Gains.

What Are Capital Losses?

When you sell an asset for less than your basis, you have a capital loss. Losses first offset gains of the same type, so short-term losses offset short-term gains and long-term losses offset long-term gains. Any net loss left over can then offset the other type. For example, if you have a $4,000 short-term loss and a $1,000 short-term gain, you’re left with a $3,000 net short-term loss, which can then offset your net long-term gains.

If your losses exceed your gains for the year, IRC Section 1211(b) lets you deduct up to $3,000 of the net capital loss against other income, such as wages or interest, or $1,500 if you’re married filing separately. Anything above that carries forward to future years under Section 1212(b) until it’s used up. That $3,000 limit hasn’t changed since 1978, and it isn’t indexed for inflation.

Losses inside an IRA work differently. Because gains in an IRA aren’t taxed, losses in an IRA can’t be deducted on your personal return either. That’s one of the real trade-offs I’ll come back to below.

When Do You Owe Capital Gains Taxes?

Capital gains are taxed in the year you sell the asset, not as the value grows. As long as you hold an investment, the gain is unrealized and generally isn’t taxable. If you bought an asset for $10,000 five years ago and sold it this year for $30,000, you’d owe tax on the $20,000 gain this year only, even though the value climbed over five years.

Inside an IRA, timing matters in a different way. The sale itself isn’t a taxable event, but when and how you take money out of the account determines your income tax bill and whether you face an early withdrawal penalty.

Ways to Reduce or Avoid Capital Gains Tax

There’s no single trick that makes capital gains tax disappear, but a few strategies can meaningfully reduce what you owe.

  • Tax-loss harvesting. Selling investments that have dropped in value lets you use those losses to offset gains elsewhere in your portfolio. Watch the wash sale rule, which disallows the loss if you buy the same or a substantially identical security within 30 days before or after the sale.
  • Holding for more than a year. Simply crossing the one-year mark can drop your rate from as high as 37% to 20% or less.
  • Using tax-advantaged accounts. Traditional IRAs and 401(k) plans defer tax until withdrawal, and Roth accounts can eliminate it on qualified distributions.
  • Municipal bonds. Interest on most municipal bonds is exempt from federal income tax, which helps reduce your overall tax bill. Keep in mind that selling a municipal bond at a profit can still produce a taxable capital gain.

Capital Gains and Mutual Funds

Mutual funds are required to distribute their net realized capital gains to shareholders, usually near the end of the year. That means you can owe tax on gains from trades the fund manager made, even if you never sold a share and even if the fund lost value for the year. Short-term gains are paid out as ordinary dividends and taxed at your ordinary income rate.

Holding mutual funds, or a professionally managed investment fund, inside an IRA or 401(k) generally shields you from tax on those distributions. The fund’s internal trading becomes a non-event for tax purposes as long as the money stays in the account.

Taxation of Traditional and Roth IRAs

With a traditional IRA, contributions are made with pre-tax dollars and are often deductible, depending on your income and whether you’re covered by a workplace plan. The money grows tax-deferred, and withdrawals are taxed as ordinary income, regardless of whether the growth came from interest, dividends, or capital gains.

A Roth IRA flips the order. You contribute after-tax dollars, and qualified withdrawals are completely tax-free. To be qualified, you generally need to be at least 59½ and have had a Roth IRA open for at least five years. The Roth is especially valuable if you expect to be in a higher tax bracket in retirement, or if you’re investing in assets with big upside potential.

 

Traditional IRA

Roth IRA

Contributions

Pre-tax, often deductible

After-tax

Capital gains inside the account

Not taxed

Not taxed

Qualified withdrawals

Taxed as ordinary income

Tax-free

Early withdrawals before 59½

Income tax plus 10% penalty, unless an exception applies

Earnings may face income tax plus 10% penalty, unless an exception applies

The 10% early withdrawal penalty under IRC Section 72(t) has several exceptions, including withdrawals for qualified higher education expenses, which apply to both traditional and Roth IRAs.

How Capital Gains Tax in an IRA Works with a Self-Directed IRA

Income and gains generated inside an IRA are not subject to ordinary income or capital gains tax when realized, no matter how long the asset was held. A gain on a stock held for three weeks gets the same treatment as a gain on a rental property held for ten years. Tax only enters the picture when money comes out, and for a Roth IRA, not even then if the distribution is qualified.

That’s why active traders tend to benefit the most. Outside an IRA, frequent short-term trading generates gains taxed at ordinary income rates of up to 37%, plus the 3.8% net investment income tax for higher earners. Inside an IRA, you can trade as often as you like without generating a tax bill on each sale.

The same logic applies to alternative assets. I discovered how much flexibility the Self-Directed IRA offers back in 2008, when a client asked me whether he could use his retirement funds to buy real estate. I went to the law library, and within two hours I had the answer. That research became the foundation for IRA Financial. With a Self-Directed IRA, you can hold real estate in an IRA, private companies, precious metals, cryptocurrency, and other alternatives, and the gains on those investments are sheltered just like stock gains.

When an IRA Can Owe Tax: UBTI and UDFI

There’s one important exception that a lot of investors don’t know about. An IRA can owe tax on unrelated business taxable income (UBTI) under IRC Sections 511 through 514. This typically comes up in two situations. The first is when the IRA invests in an operating business through a pass-through entity such as an LLC or limited partnership. The second is when the IRA buys real estate using a nonrecourse loan, which creates unrelated debt-financed income (UDFI). In that case, the share of rental income and the share of any capital gain on sale attributable to the debt can be taxable.

The first $1,000 of UBTI is exempt, but above that the IRA files Form 990-T and pays tax at trust rates, which are highly compressed. For 2026, trust income above $16,000 is taxed at 37%. If you’re planning a leveraged real estate purchase, this is worth modeling before you close. It’s also one reason some self-employed investors use a Solo 401(k) for leveraged real estate, since qualified plans are generally exempt from UDFI on real estate under IRC Section 514(c)(9).

The Trade-Offs of Holding Assets in an IRA

The IRA isn’t the best home for every asset. Because gains aren’t taxed, losses can’t be used either. And if you own real estate personally, you can take depreciation, deduct expenses against your own income, and potentially use pass-through losses, none of which help you when the property sits inside an IRA. Personal ownership does come with depreciation recapture when you sell, but those deductions can still be valuable along the way.

In my view, a Roth IRA is the most favorable place to hold a high-growth asset, since the gains may never be taxed. Holding the asset personally, with access to long-term capital gains rates, depreciation, and loss deductions, is likely next. A pre-tax IRA gives you deferral, but every dollar eventually comes out as ordinary income. The right answer depends on the asset, your tax bracket today and in retirement, and how long you plan to hold.

Self-Directed IRA Rules and Regulations

A Self-Directed IRA follows the same tax rules as any other IRA, but it lets you invest in a wide range of assets beyond stocks, bonds, and mutual funds, including real estate, cryptocurrency, private companies, and precious metals. A few rules matter most:

  • Keep IRA assets separate. Assets must be held in the name of the IRA, and IRA funds can’t be mixed with your personal money.
  • Contribution limits. For 2026, you can contribute up to $7,500 to an IRA, or $8,600 if you’re 50 or older, per the IRS. See our full breakdown of the 2026 401(k) and IRA contribution limits.
  • Prohibited investments. An IRA can’t invest in life insurance contracts under IRC Section 408(a)(3) or in most collectibles under Section 408(m), such as art, antiques, gems, and most coins. Certain gold, silver, platinum, and palladium bullion that meets IRS fineness standards is an exception.
  • Prohibited transactions. Under IRC Section 4975, your IRA can’t transact with disqualified persons, which include you, your spouse, your parents and children, and entities you control. You also can’t personally benefit from an IRA asset, such as staying in a vacation home your IRA owns.

The cost of holding these assets matters too, since fees compound against your returns just like taxes do. At IRA Financial, we charge a flat $495 annual fee for the Self-Directed IRA, with no fees based on asset value, which is one reason more than 27,000 clients trust us with over $8 billion in alternative assets.

Final Thoughts

Capital gains tax is one of the most predictable costs of investing, and one of the most controllable. Where you hold an asset can matter as much as what you buy. For active traders and investors in real estate or other alternatives, an IRA, and especially a Roth IRA, can let gains compound for decades without an annual tax drag. Just go in with your eyes open on the trade-offs, including lost deductions and the UBTI rules for leveraged or business investments. If you take the time to match each asset to the right account, you’ll keep more of what you earn.

This content is for educational purposes only and does not constitute legal, tax, or investment advice. Consult a qualified professional before making any investment decisions.

Adam Bergman

Adam Bergman is a tax attorney and the founder of IRA Financial, one of the largest Self-Directed IRA platforms in the United States. He has helped more than 27,000 clients take control of their retirement savings, overseeing over $8 billion in retirement assets. Adam is also the author of nine books focused on helping investors understand and confidently manage their retirement strategies.

IRA Financial (IRAF) is not a law firm and does not provide legal, financial, or investment advice. No attorney-client relationship exists between the Client and IRAF, its staff, or in-house counsel. IRAF offers retirement account facilitation and document services only. Clients should consult qualified legal, tax, or financial professionals before making investment decisions. IRAF does not render legal, accounting, or professional services. If such services are needed, seek a qualified professional. Custodian-related service costs are not included in IRAF’s professional services.

Privacy Preference Center