Capital Gains Tax: What You Owe When You Sell (and How to Owe Less)
You bought stock for $5,000 and sold it for $9,000. That $4,000 profit gets taxed, sure. But how much you actually hand over hinges on one thing most people never think about: how long you held it. Here's the math.
You bought a stock for $5,000. Some time later, you sell it for $9,000. Nice โ a clean $4,000 win. But before you go spend it, the tax office wants a word.
How big a word? That depends almost entirely on the calendar. Hold that stock for 366 days instead of 360, and your bill on the exact same profit can drop by hundreds of dollars. Same gain. Same you. Different tax, purely because of timing.
That's the quiet rule sitting underneath capital gains tax. Most people never learn it until after they've already sold. Let's fix that now.
What a capital gain actually is
A capital gain is the profit you make when you sell something for more than you paid. Stocks, a rental property, crypto, a chunk of land, even a collectible โ if it went up in value and you sold, you've got a gain.
The formula is short:
capital gain = sale price - cost basis
Sale price is easy. Cost basis is where people fumble. Your basis isn't just the sticker price you paid โ it's what you paid plus the fees and commissions tied to buying and selling. Bought shares for $5,000 and paid a $20 brokerage fee? Your basis is $5,020, not $5,000. So track those costs. They shrink your taxable gain, which is the same thing as shrinking your tax.
Quick gut check before we go further. You only owe capital gains tax when you actually sell. A stock that doubles on paper and just sits in your account isn't taxed at all. The gain becomes real โ "realized," in tax-speak โ the moment you sell.
The one-year line that changes everything
Here's the rule worth tattooing somewhere visible. In the US, the tax you pay splits into two buckets, and the only thing that decides which bucket is how long you owned the asset.
- Short-term gain โ you held the asset for one year or less. This gets taxed at your ordinary income tax rate, the same rate as your paycheck. That can run as high as 37%.
- Long-term gain โ you held the asset for more than one year. This gets the friendly rates: 0%, 15%, or 20%, depending on your taxable income.
One day on the calendar separates those two worlds. Buy on March 10th and sell on March 10th the following year? Still short-term. You need more than a year, so sell on March 11th or later to cross into long-term territory.
And the reward for patience is real money. Let me show you.
A worked example you can follow
Back to that stock. You bought it for $5,000 and sold it for $9,000, so:
$9,000 - $5,000 = $4,000 gain
Now picture two versions of yourself, both sitting in the 24% ordinary income bracket. One sold after 11 months. The other waited 13.
| Short-term (held 11 months) | Long-term (held 13 months) | |
|---|---|---|
| Capital gain | $4,000 | $4,000 |
| Tax rate applied | 24% (ordinary) | 15% (long-term) |
| Tax owed | $960 | $600 |
| You keep | $3,040 | $3,400 |
Same $4,000 profit. The short-term seller hands over $960. The patient one pays $600. That's a $360 gap for roughly two extra months of holding โ and you pocket the difference.
Now scale it up. On a $40,000 gain instead of $4,000, that same 9-percentage-point swing is $3,600. On a property sale, it can climb into five figures. The bigger the gain, the more that one-year line matters.
Want to run your own numbers without doing the arithmetic by hand? The Capital Gains Tax Calculator lets you plug in your purchase price, sale price, holding period, and income, then shows the short-term versus long-term outcome side by side.
Losses are useful too
Not every sale is a winner. And the tax system actually rewards you for that โ a small mercy. When you sell one investment at a loss, that loss can cancel out gains elsewhere. It's called tax-loss harvesting, and it's one of the few legal ways to deliberately lower your bill.
Say you've got two sales this year:
- Sold Stock A for a $4,000 gain.
- Sold Stock B for a $1,500 loss.
The loss offsets the gain. You're only taxed on $4,000 - $1,500 = $2,500. At a 15% long-term rate, that drops your tax from $600 to $375.
What if your losses outrun your gains? The US lets you deduct up to $3,000 of the excess against your regular income each year, then carry anything left over into future years. A bad year can soften a future good one. Just watch out for the "wash sale" trap: sell something at a loss and buy back the same security within 30 days, and the deduction gets disallowed. Sell, then sit on your hands for a month.
How to owe less, ranked by hassle
There's no magic switch here. But a few moves do most of the heavy lifting.
- Just wait. Crossing the one-year mark is the simplest, lowest-effort way to cut the bill. If you're 11 months in and don't urgently need the cash, those extra weeks can be the best-paid waiting you'll ever do.
- Harvest losses. Pair winning sales with losing ones in the same tax year so the gains shrink.
- Mind your bracket. The long-term 0% rate is real. Lower-income years โ a sabbatical, early retirement, a gap between jobs โ can be the perfect time to realize gains nearly tax-free.
- Track every cost. Fees, commissions, and improvements on property all lift your basis and lower the taxable gain. Keep the receipts.
- Use tax-sheltered accounts. Gains inside retirement accounts generally aren't taxed year to year, sidestepping the question entirely.
None of these need a clever accountant. They mostly need you to know the rules before you click sell.
A note for readers outside the US
Everything above runs on US federal rules, and US state taxes sit on top. Some states tax gains as ordinary income; a handful charge nothing extra. So your real rate may land higher than the federal figure alone.
The broad idea travels, though. The UK, Canada, and Australia all tax capital gains in some form, each with its own twist. Canada taxes only a portion of the gain. Australia gives a discount for assets held longer than a year โ that familiar reward-for-patience theme again. The UK runs an annual tax-free allowance before gains count at all. Different rules, same underlying logic: sell for a profit, expect to share a slice.
One more thing worth remembering. A "gain" on paper isn't always a gain in buying power. If an asset rose 20% over five years but prices climbed right along with it, your real profit is thinner than the number suggests. The Inflation Calculator can show you what your gain is actually worth in today's money โ sometimes a humbling little exercise.
The takeaway
Capital gains tax isn't a punishment for investing well. It's a predictable cost you can plan around, and the single biggest lever is one you already control: time. Hold past a year. Offset your winners with your losers. Keep clean records of what you paid.
So before your next sale, run the two scenarios. See what short-term costs you versus long-term, then decide whether a few more weeks of patience is worth real dollars in your pocket. The Capital Gains Tax Calculator does the math in seconds โ check it before you sell, not after.
Try the calculators mentioned in this article
Browse all calculators
