How Capital Gains Tax Works: Holding Periods, the 0% Bracket and the Math Before You Sell

How capital gains tax really works: the one-year holding line, the 0%, 15% and 20% brackets for 2026 and 2027, worked examples showing how gains stack on your income, loss…

Stack of blank stock certificates beside an open notebook, calculator, pen and glasses, representing figuring capital gains tax on an investment sale

Most people learn how capital gains tax works the hard way: they sell something that went up, and a surprise shows up on next spring’s return. I’d rather you learn it now, with a pencil and a few real numbers. Still, the rules aren’t complicated once you see the moving parts. Better yet, a little planning before you sell can legally keep thousands of dollars in your pocket.

Here’s the plain version. You owe tax on the profit when you sell an investment, not on the price. Then, how long you held it decides which rate applies. And your other income decides where on the rate ladder that profit lands. Everything below also builds on those three ideas, using the 2026 figures from IRS Revenue Procedure 2025-32 and the 2027 figures the IRS announced on Nov. 5, 2026.

What Capital Gains Tax Actually Taxes

The IRS treats almost everything you own for personal or investment use as a capital asset. In general, that includes stocks, bonds, funds, real estate and even your home. When you sell one, the gain or loss equals what you received minus your adjusted basis. In most cases, basis simply means what you paid, plus certain costs, so start there.

Three details trip people up:

  • The gain is profit, not proceeds. If you bought shares for $5,000 and sold them for $9,000, the taxable gain is $4,000, not $9,000.
  • Basis can be higher than you think. Dividends you reinvested were already taxed when they were paid, so those purchases count toward your basis. Ignore them, and you end up paying tax twice on the same money.
  • Losses on personal-use items don’t count. According to IRS Topic 409, a loss on your car or your home isn’t deductible, even though a gain on them can be taxable.

Inherited and gifted property follow their own basis rules, which the IRS spells out in Publication 551. If you’re selling something you inherited, look that up first, because the answer often works in your favor.

Short-Term vs. Long-Term: The One-Year Line

In short, the single biggest lever in capital gains tax is time. Under IRS rules, an asset held more than one year produces a long-term gain. An asset held one year or less produces a short-term gain.

That difference matters because short-term gains are taxed as ordinary income at your regular bracket, which runs as high as 37%. By contrast, long-term gains get their own lower schedule of 0%, 15% or 20%. If you need a refresher on how brackets stack, I walked through it in how tax brackets work.

How to count the holding period

The IRS says you generally count from the day after you bought the asset, up to and including the day you sell. So, if you bought shares on March 10, 2026, a sale on March 10, 2027, is still short-term. Wait one more day, and a sale on March 11, 2027, qualifies as long-term. One day can change the rate on the entire gain. That’s why you should check your trade confirmations before you click sell.

2026 and 2027 Long-Term Capital Gains Tax Rates

These thresholds are based on taxable income, meaning income after your standard or itemized deduction. They are not tied to the size of the gain alone, either. For 2026, the standard deduction is $16,100 for single filers and $32,200 for married couples filing jointly. For 2027, those rise to $16,600 and $33,200.

Filing status2026: 0% rate up to2026: 15% rate up to2027: 0% rate up to2027: 15% rate up to
Single$49,450$545,500$51,050$563,200
Married filing jointly$98,900$613,700$102,100$633,600
Head of household$66,200$579,600$68,350$598,400
Married filing separately$49,450$306,850$51,050$316,800
Long-term capital gains thresholds by taxable income. Source: IRS Rev. Proc. 2025-32 and Rev. Proc. 2026-35.

The 20% rate applies only to the portion of taxable income above the 15% ceiling. A few special categories run higher. For example, gains on collectibles such as coins or art can be taxed at up to 28%. Likewise, the part of a real estate gain tied to past depreciation (unrecaptured Section 1250 gain) can be taxed at up to 25%.

Now notice something about that table. A married couple with $98,900 of taxable income, which could mean roughly $131,100 of gross income after the $32,200 standard deduction, pays zero federal tax on long-term gains that fit under the line. Yet many middle-income families have no idea that room exists.

How to Calculate Capital Gains Tax: A Worked Example

The key concept here is stacking, because the gain never stands alone. Your ordinary income fills the brackets first. Then your long-term gain sits on top of it, and each slice of the gain takes whatever capital gains rate matches its position.

Let’s use a hypothetical married couple filing jointly in 2026:

  1. Find ordinary taxable income. After the standard deduction, their wages leave $80,000 of taxable ordinary income.
  2. Add the gain. They sell index fund shares held for six years, with a $30,000 long-term gain. Total taxable income is now $110,000.
  3. Fill the 0% band. The 0% ceiling is $98,900, so $18,900 of the gain ($98,900 minus $80,000) is taxed at 0%.
  4. Tax the rest at 15%. The remaining $11,100 is taxed at 15%, which comes to $1,665.

As a result, their federal tax on a $30,000 gain is $1,665, an effective rate of about 5.6%.

Now run the same sale as a short-term gain. In that case, the $30,000 gets taxed like wages. Specifically, $20,800 falls in the 12% bracket (up to $100,800), and $9,200 falls in the 22% bracket. That works out to $2,496 plus $2,024, or $4,520 in tax. Simply holding past the one-year line saves them $2,855 on the same profit.

A second example: the 0% bracket in action

Consider a single filer with $40,000 of taxable ordinary income who sells stock with an $8,000 long-term gain. Total taxable income is $48,000, which is under the $49,450 ceiling for 2026. As a result, the federal tax on that gain is $0. She still has to report the sale on Form 8949 and Schedule D, but she owes nothing on it.

Blank calendar, open notebook, calculator and a jar of coins on a desk, representing tracking the one-year holding period for long-term capital gains tax

Using Losses to Offset Gains

Losses aren’t fun, but they can be useful. Capital losses first offset capital gains. Then, if losses exceed gains, the IRS lets you deduct up to $3,000 of the excess against other income each year ($1,500 if married filing separately). Anything beyond that carries forward to future years.

For example, say you have $10,000 of gains this year and $14,000 of losses. The losses wipe out the gains, leaving a $4,000 net loss. You deduct $3,000 against your wages, and the remaining $1,000 carries into next year.

This is also the logic behind tax-loss harvesting, which gets a lot of attention every December. You sell a losing position to bank the loss, then stay invested with something similar.

Watch the wash sale rule

The catch is the wash sale rule. IRS Publication 550 says you can’t deduct the loss if, within 30 days before or after the sale, you buy substantially identical stock or securities. That includes purchases inside your IRA or Roth IRA, and purchases by your spouse. The disallowed loss isn’t gone forever, though. Instead, it gets added to the basis of the new shares. Still, it defeats the purpose of harvesting it this year.

The Extra 3.8% Tax and Other Rules Worth Knowing

Higher earners, however, face one more layer. The Net Investment Income Tax adds 3.8% on the lesser of your net investment income or the amount your modified adjusted gross income exceeds a threshold. The thresholds are $200,000 for single filers and heads of household, $250,000 for married couples filing jointly, and $125,000 for married filing separately.

For example, a single filer with $260,000 of modified AGI, including $80,000 of investment income, is $60,000 over the line. The tax applies to the smaller number, $60,000, so the extra bill is $2,280.

A few other rules deserve a spot on your checklist:

  • Selling your home. According to IRS Topic 701, you may exclude up to $250,000 of gain, or $500,000 on a joint return, if you owned and lived in the home for at least two of the five years before the sale.
  • Retirement accounts. Trades inside a 401(k) or IRA don’t trigger capital gains tax each year. Traditional account withdrawals are taxed as ordinary income, and qualified Roth withdrawals are tax-free. My Roth IRA vs. traditional IRA guide covers that choice.
  • Estimated taxes. A large gain can mean you owe estimated tax during the year rather than waiting until April. See my guide to quarterly estimated taxes.
  • State taxes. Most states tax capital gains too, often as regular income. Check your state’s rules before you assume the federal math is the whole bill.

Common Capital Gains Tax Mistakes

These are the most common errors, and almost all of them are avoidable:

  • Selling a few days early. Missing the one-year mark by a week can turn a 15% rate into a 22% or 24% rate.
  • Forgetting reinvested dividends in basis. That overstates your gain. Brokers track basis for most newer purchases, but older shares and transferred accounts deserve a second look.
  • Assuming 0% means “don’t report.” Every sale still goes on the return, even when the tax is zero.
  • Triggering a wash sale through an IRA. Buying the same fund in your retirement account within 30 days still kills the loss.
  • Letting the tax tail wag the dog. Holding a stock you no longer believe in just to dodge tax can cost more than the tax ever would.

Of course, that last point matters most to me. Taxes are a cost to manage, not the reason to own or sell something. A 15% tax on a real gain still leaves you with 85% of a profit. Refusing to sell a fading position can leave you with less.

Is the Lower Rate Fair? The Honest Debate

I’ll give you my view, and then the strongest case against it. I think a lower rate on long-term gains is sound policy. It rewards patience over speculation, and it encourages people to put savings to work in businesses that hire and build. Also, the investment was usually made with money that was already taxed once as wages. Moreover, gains aren’t adjusted for inflation, so part of a long-held “gain” is just the dollar losing value. A lower rate partly offsets that.

The fair counterargument is that capital gains flow mostly to households that already hold the most wealth. Critics say that taxing a dollar of investment profit less than a dollar of wages tilts the system toward people who own assets over people who work for a paycheck. That’s a serious point. Even so, I land on the side of encouraging long-term ownership, and I’d rather widen it by helping more families start investing early. My index fund guide is a good starting place.

Finally, there’s a stewardship angle I can’t ignore. Proverbs talks about steady, diligent planning beating haste, and the tax code happens to reward the same thing. Patient owners keep more.

A Pre-Sale Checklist

Before you sell anything with a gain, run through these steps:

  1. Confirm the purchase date and whether you’re past the one-year line.
  2. Pull your cost basis, including reinvested dividends.
  3. Estimate your taxable income for the year to see which rate band the gain lands in.
  4. Check whether you have losses, or carryforwards, to offset it.
  5. Look for wash sale conflicts 30 days on either side, including IRAs and your spouse’s accounts.
  6. Decide whether a large gain calls for an estimated tax payment.
  7. Consider splitting a big sale across two tax years if it would push you into a higher band.

If dividends are part of your plan, qualified dividends use this same 0%, 15% and 20% schedule. I cover them in detail in how dividends work.

The Bottom Line on Capital Gains Tax

Capital gains tax rewards people who plan ahead. Hold past a year when it makes sense, know where your taxable income lands, use losses wisely, and avoid the wash sale trap. Do those four things, and you’ll keep more of every dollar your investments earn. The examples here are hypothetical and federal-only, and real returns can involve state taxes and special situations.

This article is for educational purposes only and is not personal financial, investment, tax, or legal advice. Consider talking with a qualified tax professional about your situation.

Sources

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *