Skip to main content
Capital Gains Tax Explained: Short-Term vs Long-Term, Cost Basis, and Tax-Loss Harvesting
Back to all articles

Capital Gains Tax Explained: Short-Term vs Long-Term, Cost Basis, and Tax-Loss Harvesting

SimpleCalculators.net Team12 min read
Disclaimer: This article is for educational purposes only and does not constitute tax or financial advice. Tax rates, thresholds, and rules change annually and vary by jurisdiction. Consult a qualified tax professional or accountant for advice specific to your situation.

I sold a stock 11 days before its one-year anniversary because I needed the cash for a deposit. I didn't think twice about the date — until I did my taxes and realized those 11 days had cost me roughly $1,400. The gain was taxed at my ordinary income rate instead of the long-term capital gains rate, because I'd missed the one-year mark by less than two weeks. Nobody had ever explained to me that the calendar, not just the dollar amount, decides how much of a capital gain you actually keep.

That single date is the most expensive detail in capital gains tax, and it's one most people never learn until it costs them money. This article walks through exactly how capital gains tax works — short-term vs long-term rates, how your cost basis is calculated, how tax-loss harvesting can offset gains, and the mistakes that trip up even experienced investors — so you can plan a sale instead of just reacting to one.


What Is Capital Gains Tax?

Capital gains tax (CGT) is a tax on the profit you make when you sell a capital asset for more than you paid for it — stocks, cryptocurrency, real estate, or a business. It's charged only on the gain, not the full sale price. Sell a stock for $10,000 that you bought for $6,000, and the tax applies to the $4,000 profit, not the $10,000 you received.

This trips people up constantly. Someone sees a $10,000 deposit hit their brokerage account and assumes that's the taxable event. It isn't — the IRS, HMRC, the ATO, and the CRA all tax the gain, calculated as:

Capital Gain = Sale Price − Cost Basis − Selling Costs

If the asset lost value instead, that's a capital loss — and as you'll see in the tax-loss harvesting section below, losses aren't just bad news. They're a tool.

Key Takeaway

Capital gains tax is only ever charged on profit, never on the full proceeds of a sale. The three numbers that determine your bill are your sale price, your cost basis, and how long you held the asset before selling.


Short-Term vs Long-Term: Why the Calendar Matters

This is the single biggest lever most investors don't use. In the US, an asset held one year or less before selling produces a short-term gain, taxed at your ordinary income tax rate — up to 37% for top earners in 2026. Hold it for more than one year, and it becomes a long-term gain, taxed at the much friendlier 0%, 15%, or 20% federal rate depending on your taxable income.

Filing status (2026, approx.)0% rate15% rate20% rate
SingleUp to ~$48,350~$48,350–$533,400Above ~$533,400
Married filing jointlyUp to ~$96,700~$96,700–$600,050Above ~$600,050

That gap between 37% and 15% on a large gain is not a rounding error — it's real money, and the only thing separating them is a single day on a calendar. My $1,400 mistake at the start of this article is a small example of a pattern that plays out at every income level, just with more zeros attached the bigger the gain.

⚠️ Note

The holding period clock starts the day *after* you acquire the asset and ends on the day you sell it. If you're close to the one-year mark and the position hasn't moved much, it's worth checking the exact purchase date before you click sell.


How Cost Basis Actually Works

Cost basis is what you paid for an asset, including commissions and fees, adjusted for events like stock splits, reinvested dividends, or capital improvements. Get this number wrong and every downstream tax calculation is wrong too — which is why it's worth tracking carefully rather than estimating from memory.

For stocks and crypto, basis usually means purchase price plus fees. But it's rarely one clean number:

  • Reinvested dividends increase your basis — each reinvestment is technically a new purchase at that day's price.
  • Stock splits don't change your total basis, but they change your per-share basis and share count.
  • Real estate basis includes the purchase price plus capital improvements (a new roof, an addition) but not routine repairs or maintenance.
  • Inherited assets typically get a "stepped-up" basis to fair market value on the date of the original owner's death — which can eliminate decades of embedded gains entirely.
  • Gifted assets usually carry over the giver's original basis, not the value on the day you received them.

Close-up of an elderly woman holding a pen with a financial report

💡 Pro Tip

Keep every trade confirmation and dividend reinvestment statement, ideally in one folder or brokerage export, even if your broker reports basis to the IRS. Basis-reporting errors are common, especially for assets transferred between brokers, and the burden of proving the correct number falls on you.


Worked Example: Selling Appreciated Stock

Say an investor in the US bought 200 shares of a stock at $45 each, paying a $15 commission. Eighteen months later, they sell all 200 shares at $78 each, paying another $15 commission.

Step 1: Calculate cost basis 200 × $45 = $9,000 + $15 commission = $9,015

Step 2: Calculate sale proceeds 200 × $78 = $15,600 − $15 commission = $15,585

Step 3: Calculate the gain $15,585 − $9,015 = $6,570 gain

Step 4: Apply the long-term rate Because the shares were held 18 months (over one year), this qualifies as a long-term gain. At a 15% federal rate: $6,570 × 0.15 = $985.50 owed

Had they sold at the 11-month mark instead, the same $6,570 gain taxed at a 32% ordinary income bracket would owe $2,102.40 — more than double, for identical numbers, purely because of timing. In the UK, the same investor would first apply their annual CGT allowance (£3,000 for 2024/25) before the remainder is taxed at 10% or 20% depending on their income band; in Australia, holding an asset over 12 months triggers a 50% CGT discount, so only half the gain is taxable at all.

Run your own numbers — including the effect of switching between short-term and long-term — with the Capital Gains Tax Calculator.


Tax-Loss Harvesting: Turning Losers Into a Tax Break

Tax-loss harvesting is the practice of selling an investment at a loss specifically to offset capital gains realized elsewhere in your portfolio, reducing your overall tax bill. In the US, realized losses first offset realized gains of the same type (short-term losses against short-term gains, long-term against long-term), then any type against the other, and up to $3,000 of excess losses can offset ordinary income each year — with any remainder carried forward indefinitely.

Net Taxable Gain = Total Gains − Total Losses (− up to $3,000 against ordinary income)

Say an investor has a $6,570 long-term gain from the stock sale above, but also holds a different position down $4,000 since purchase. Selling that losing position realizes a $4,000 loss, cutting the net taxable gain to $2,570 — and the tax owed from roughly $985 down to about $385.50.

The catch is the wash-sale rule: if you sell an asset at a loss and buy the same or a "substantially identical" security within 30 days before or after the sale, the loss is disallowed for tax purposes. This is designed to stop investors from selling purely to harvest a tax loss and immediately buying back into the identical position.

Flat lay of tax form, pencils, and calculator on black background


Capital Gains Around the World

Rules vary substantially outside the US, and applying US assumptions to a non-US sale is one of the most common errors international investors make.

CountryHolding period benefitNotable feature
United StatesLong-term (1yr+): 0/15/20% vs ordinary rates$3,000 annual loss offset against income
United KingdomNone — same rate regardless of holding periodAnnual tax-free allowance (£3,000 for 2024/25)
Australia50% discount after 12 monthsTaxed at marginal income rate otherwise
CanadaNone — same rate regardless of holding periodOnly 50% of the gain is included as taxable income

Real estate adds another layer everywhere — many countries exempt or partially exempt gains on a primary residence, while investment properties are usually taxed in full. If you're weighing a property sale, the Rental Income Tax Calculator and the Home Affordability Calculator can help you see the full financial picture alongside the CGT estimate.

A real estate sign indicates a property for sale as two agents discuss building plans outdoors


Common Mistakes That Cost Investors Money

  • Selling right before the one-year mark. As my own $1,400 mistake shows, a handful of days can shift an entire gain from a preferential rate to your top ordinary rate.
  • Forgetting reinvested dividends inflate basis. Investors who only count their original purchase price overstate their gain — and overpay tax — every time they've been reinvesting dividends for years.
  • Triggering a wash sale by accident. Harvesting a loss and buying the same ETF back a week later in a different account (including an IRA) still counts — the rule applies across all your accounts, not just the one where you sold.
  • Assuming reinvesting proceeds avoids the tax. In most countries, selling a capital asset is a taxable event the moment it happens, regardless of what you do with the cash afterward. The main exception is a 1031 exchange for US real estate, which has strict rules of its own.
  • Ignoring state or provincial tax. Federal rates get all the attention, but many US states tax capital gains as ordinary income on top of the federal bill — this calculator, like most general estimators, covers federal rates only.

Business professionals discussing financial data during a collaborative meeting


Frequently Asked Questions

Do I owe capital gains tax if I reinvest the proceeds?

In most countries, yes — selling a capital asset triggers a taxable event regardless of what you do with the money afterward. The main exception is a 1031 exchange for US real estate, which lets you defer tax by rolling proceeds into a similar property, but it comes with strict timelines and rules.

What's the difference between a wash sale and normal tax-loss harvesting?

Tax-loss harvesting is selling a losing position to realize a deductible loss. It becomes a disallowed "wash sale" specifically if you buy the same or a substantially identical security within 30 days before or after the sale. You can still harvest the loss and buy something similar-but-different — a different fund tracking the same index, for example — without triggering the rule.

Does crypto follow the same capital gains rules as stocks?

In the US, the IRS treats cryptocurrency as property, so the same short-term/long-term framework and cost-basis rules apply. Every disposal — including trading one coin for another, not just cashing out to fiat — is a taxable event. Rules differ elsewhere, so check local guidance before assuming crypto is treated identically to equities in your country.

Is my primary home exempt from capital gains tax?

Often partially or fully, but the details vary by country and by how long you owned and lived in the property. In the US, single filers can typically exclude up to $250,000 of gain ($500,000 for married couples filing jointly) on a primary residence if ownership and use tests are met. Investment and rental properties don't get this exclusion.

How accurate is an online capital gains estimate?

A good calculator gives you a solid federal-level estimate based on published rates and your inputs, but it won't capture state/provincial tax, alternative minimum tax, net investment income surtax, or your full personal situation. Treat it as a planning tool for comparing scenarios — like short-term vs long-term timing — not a final tax bill.


Try It Yourself

The two numbers that matter most — your cost basis and your holding period — are also the two numbers most investors get wrong or ignore until it's too late to change them. Before you sell anything appreciated, run the numbers both ways.

Try it yourself: Use the Capital Gains Tax Calculator to estimate your bill across the US, UK, Australia, and Canada, then check how a few more months of holding time — or harvesting a loss elsewhere — changes the outcome. Pair it with the Investment Calculator to see how the after-tax proceeds fit into your longer-term plan, or the Tax Bracket Calculator to see exactly where your ordinary income rate falls.

You Might Also Like