How Capital Gains Tax Works: Brackets, NIIT, and Exclusions

Capital gains tax works like this: when you sell an asset for more than you paid, the profit is taxed, and the rate depends on how long you owned the asset and how much total income you have that year. Assets held longer than one year get preferential long-term rates of 0%, 15%, or 20% for 2026. Assets held one year or less are taxed at your ordinary income rate, which tops out at 37%. High earners pay an extra 3.8% surtax on top of either.

What Triggers a Capital Gain

A capital gain arises when you sell or exchange a capital asset for more than your basis in it. The tax code defines a capital asset by exclusion: it covers almost everything you own except business inventory, depreciable business property, and certain creative works you produced yourself.1Office of the Law Revision Counsel. 26 USC 1221 – Capital Asset Defined Stocks, bonds, mutual fund shares, cryptocurrency, real estate, precious metals, artwork, collectibles, and even household furniture all fall inside that definition.2eCFR. 26 CFR 1.1221-1 – Meaning of Terms

Your basis is usually what you paid plus acquisition costs. For stocks, that means the purchase price plus brokerage commissions. For real estate, add title fees, transfer taxes, and the cost of permanent improvements. If you claimed depreciation on a rental property, each year’s depreciation reduces your basis, which enlarges your taxable gain at sale.

The gain itself is the difference between what you received from the sale (net of selling costs like commissions and closing fees) and your adjusted basis. A positive number is a gain; a negative one is a loss. Each sale of a financial asset gets reported on Form 8949, which flows into Schedule D on your return.3Internal Revenue Service. Instructions for Form 8949 (2025) Schedule D nets your short-term gains against short-term losses, your long-term gains against long-term losses, and then combines the two results.4Internal Revenue Service. 2025 Instructions for Schedule D (Form 1040)

Keep every purchase receipt, brokerage statement, and closing document. If the IRS audits you and you can’t prove your basis, they can treat it as zero, making your entire sale proceeds taxable. An overstated basis can also trigger the accuracy-related penalty of 20% of the resulting underpayment, or 40% if the overstatement is severe enough to count as a gross valuation misstatement.5Office of the Law Revision Counsel. 26 USC 6662 – Accuracy-Related Penalty

One thing that catches investors off guard: mutual funds distribute capital gains to shareholders every year, and those distributions are taxable to you even if you never sold a share. The fund sold profitable positions internally, and you owe tax on your share of the gain. These distributions are always treated as long-term regardless of how long you’ve held the fund.6Internal Revenue Service. Mutual Funds (Costs, Distributions, etc.) 4

Short-Term vs. Long-Term Holding Periods

The holding period is the single biggest lever in the rate you pay. The dividing line is one year. Assets held for one year or less produce short-term capital gains, which are added to your wages and taxed at your ordinary bracket.7Office of the Law Revision Counsel. 26 USC 1222 – Other Terms Relating to Capital Gains and Losses For 2026, the top ordinary rate is 37%.8Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026

Assets held for more than one year produce long-term gains at their own lower rates. The holding period starts the day after you buy and ends on the day you sell. Selling on the one-year anniversary of the purchase still counts as short-term. Wait one more day. That single day can be the difference between a 37% rate and a 15% rate.

2026 Long-Term Capital Gains Brackets

Long-term gains are taxed at 0%, 15%, or 20%, and the rate is set by your total taxable income and filing status. For tax year 2026, the thresholds are:9Internal Revenue Service. Rev. Proc. 2025-32

  • 0% rate: taxable income up to $49,450 for single filers and married filing separately, $98,900 for married filing jointly, and $66,200 for head of household.
  • 15% rate: taxable income above the 0% ceiling up to $545,500 single, $613,700 married filing jointly, $306,850 married filing separately, and $579,600 head of household.
  • 20% rate: taxable income above the 15% ceiling.

The thresholds apply to your total taxable income, not just your gain. If your salary already pushes you into a higher bracket, even a modest gain lands at 15% or 20%. On the other hand, if your ordinary income is low in a given year, you can pay nothing on your long-term gains. Retirees drawing down portfolios in a low-income year often benefit from the 0% bracket in ways they don’t expect.

The 3.8% Net Investment Income Tax

On top of the standard rates, higher earners face an additional 3.8% Net Investment Income Tax. The surtax applies to individuals with modified adjusted gross income above $200,000, or $250,000 for married couples filing jointly ($125,000 if married filing separately).10Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax These thresholds are not adjusted for inflation, so more taxpayers cross them each year as wages rise.11Internal Revenue Service. Questions and Answers on the Net Investment Income Tax

The NIIT is calculated on the lesser of your net investment income or the amount by which your modified AGI exceeds the threshold. For someone in the top bracket, the combined federal rate on long-term gains reaches 23.8% (20% plus 3.8%). Short-term gains at the same income level can hit 37% plus 3.8%.

Higher Rates for Collectibles and Depreciation Recapture

Two categories of long-term gains do not get the standard 0/15/20 schedule. Long-term gains on collectibles, including art, antiques, coins, stamps, and precious metals, are taxed at a maximum rate of 28%.12Internal Revenue Service. Topic No. 409, Capital Gains and Losses The 28% ceiling also applies to gains on some gold and silver ETFs that are structured as grantor trusts, a detail that surprises investors who assumed they were buying a standard financial product.

When you sell depreciable real estate at a profit, the portion of the gain attributable to depreciation you previously claimed is taxed at a maximum rate of 25%, called unrecaptured Section 1250 gain.12Internal Revenue Service. Topic No. 409, Capital Gains and Losses Buy a rental for $300,000, claim $80,000 in depreciation over the years, and sell for $400,000: the $80,000 tied to depreciation is taxed at up to 25%, while the remaining $100,000 of appreciation gets the regular long-term rate.13Office of the Law Revision Counsel. 26 US Code 1 – Tax Imposed Rental owners who skip this step in their planning consistently underestimate the tax bill at sale.

Losses, the $3,000 Deduction, and Wash Sales

When your total capital losses exceed your total capital gains for the year, you can deduct up to $3,000 of the net loss against your other income ($1,500 if married filing separately). Anything left carries forward to future years indefinitely until it’s used up.12Internal Revenue Service. Topic No. 409, Capital Gains and Losses A large loss from a bad investment can reduce your taxes for years afterward.

Personal-use losses are different. Selling a couch on a marketplace app for more than you paid technically creates a reportable gain, but selling it at a loss gives you no deduction because personal-use losses aren’t deductible.

Then there’s the wash sale rule. If you sell a stock or security at a loss and buy the same or a substantially identical one within 30 days before or after the sale, the IRS disallows the loss deduction.14Office of the Law Revision Counsel. 26 US Code 1091 – Loss From Wash Sales of Stock or Securities The rule prevents harvesting a loss while immediately re-establishing the same position.

The loss isn’t permanently gone. The disallowed amount is added to the basis of the replacement shares, so you’ll recognize a smaller gain (or larger loss) when you eventually sell those. You just can’t claim the deduction now. The rule applies to stocks, options, and contracts to acquire stock. It does not currently apply to cryptocurrency in the same way, though guidance in that area continues to evolve. Brokerages track wash sales on Form 1099-B, but only within a single account. Sell at a loss in one brokerage and buy the same stock in another within 30 days, and you’re still subject to the rule even though neither broker flagged it.

Selling Your Home: The Primary Residence Exclusion

If you sell your main home at a profit, you can exclude up to $250,000 of the gain from your income, or $500,000 if you’re married filing jointly.15Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence To qualify, you must have owned the home and lived in it as your primary residence for at least two of the five years before the sale. The two years don’t need to be consecutive. You can use the exclusion only once every two years.

Any gain above the exclusion is taxed at long-term rates if you’ve owned the home for more than a year. For the joint $500,000 exclusion, both spouses must meet the use test, but only one needs to meet the ownership test.

If you sell before hitting the two-year requirement, a partial exclusion may still apply when the sale is prompted by a change in employment, health reasons, or certain unforeseen circumstances. The excluded amount is prorated based on how much of the two-year period you completed.16Office of the Law Revision Counsel. 26 US Code 121 – Exclusion of Gain From Sale of Principal Residence A job relocation after 14 months, for example, would let you exclude roughly 58% of the full amount.

Inherited vs. Gifted Assets: Basis Works Differently

How you acquired an asset changes the whole calculation. When you inherit property, the basis resets to the fair market value on the date of the original owner’s death. This is the stepped-up basis rule, and it can erase decades of unrealized appreciation in one step.17Office of the Law Revision Counsel. 26 US Code 1014 – Basis of Property Acquired From a Decedent If your parent bought stock for $10,000 and it was worth $200,000 when they died, your basis is $200,000. Sell it the next month for $205,000, and you owe tax on just $5,000 of gain.

Gifts work the opposite way. When someone gives you property during their lifetime, you take the donor’s basis, not the current market value. This is called carryover basis.18Office of the Law Revision Counsel. 26 US Code 1015 – Basis of Property Acquired by Gifts and Transfers in Trust Same stock, same numbers, but gifted during life instead of inherited: your basis is $10,000, and selling for $205,000 leaves you with a $195,000 taxable gain. One protective wrinkle: if the fair market value at the time of the gift was lower than the donor’s basis, you use the fair market value as your basis when calculating a loss.19Internal Revenue Service. Property (Basis, Sale of Home, etc.)

State Taxes Come on Top

Federal rates are only part of the number you’ll owe. Most states tax capital gains as ordinary income, so your combined rate depends on where you live. State rates on investment gains generally range from zero to above 13%, with nine states imposing no tax on capital gains at all. A few states apply special rules, such as taxing long-term gains only above a certain dollar threshold. When you’re planning a major sale, factoring in your state’s rate alongside the federal brackets and the NIIT gives you the actual bill.