How capital gains tax is computed
By Jude Wallis
Capital gains tax is charged on proceeds minus basis, not on what the sale brought in. Sell for $40,000 something that cost $25,000 and the gain is $15,000. At 15 percent the tax is $2,250; at 20 percent the same gain costs $3,000.
Capital gains tax
$2,250.00
$15,000.00 of realised gain at 15.0%.
- Realised gain
- $15,000.00
- Tax
- $2,250.00
Put this on a class page: one iframe, free, for Google Sites, Canvas, WordPress or Notion.
On this page
In short
- Gain is proceeds minus basis: $40,000 minus $25,000 is $15,000.
- The rate applies to the gain alone, so 15 percent of $15,000 is $2,250.
- At a 20 percent rate the same gain costs $3,000, with nothing about the trade itself changed.
- Basis includes purchase costs and reinvested distributions, and getting it wrong misstates the tax in either direction.
- The holding period decides which rate schedule applies before any of this arithmetic runs.
The gain is the taxable event, not the sale
A $40,000 sale does not produce a $40,000 tax base. Subtract the $25,000 basis first and the gain is $15,000, which is what the rate is applied to. That distinction is the single biggest source of unnecessary alarm about selling an investment.
At 15 percent, the tax on this gain is $2,250. Most of the sale proceeds are a return of money that was already yours, and the tax touches only the growth on top of it.
Basis is where the errors live
Basis starts at what you paid and moves from there. Commissions and purchase costs raise it. Reinvested dividends raise it, which is the one that most often gets missed and causes the same money to be taxed twice: once as a dividend when it was reinvested, and again as gain because the basis was never adjusted.
Return-of-capital distributions lower it. Corporate actions can restate it entirely. Keeping the running figure is the difference between a correct gain and a plausible one, and only a correct basis produces a correct tax.
The rate arrives from outside the calculation
Nothing inside this identity decides the rate. The holding period does, and so does your income level and the type of asset. A sale inside a year is generally taxed as ordinary income; longer than that and a separate schedule applies. Short-term against long-term gains prices what one day either side of the anniversary is worth.
Because the rate comes from outside, the same $15,000 gain can cost $2,250 or $3,000, depending on facts that have nothing to do with the trade. The tax brackets calculator shows where income falls, and marginal tax rate explains the stacking.
What sits alongside the identity
Losses offset gains before any tax is due, which is what tax-loss harvesting works with, and the tax loss harvest calculator prices it. Gains inside tax-advantaged accounts are outside this rule entirely. A main home has its own exclusion, covered in how the home sale exclusion works. The capital gains tax calculator runs the gain and the tax from the three figures you supply. This is educational material, not financial advice.
Worked examples
A \$15,000 gain at 15 percent
An asset bought for $25,000 is sold for $40,000, and the applicable rate is 15 percent. What is the tax?
- Gain is 40,000 minus 25,000, which is $15,000.
- Apply the rate to the gain: 15 percent of 15,000 is $2,250.
The tax is $2,250 on a $15,000 gain, not on the $40,000 of proceeds.
The same gain in a higher band
Identical $40,000 proceeds and $25,000 basis, but the applicable long-term rate is 20 percent.
- The gain is unchanged at $15,000.
- 20 percent of that is $3,000.
$3,000. A higher income moved the rate, and the trade itself was identical.
Common questions
Is the tax charged on the sale price?
No. It is charged on the gain. Here that is $15,000, not the $40,000 that arrived in the account.
What if I sell at a loss?
There is no gain to tax, and the loss usually offsets other gains before anything is owed.
Do reinvested dividends change the basis?
Yes. They were already taxed, so adding them to basis stops the same money being taxed a second time.
Is this financial advice?
No. It is educational material about how a gain and its tax are calculated.
Keep reading
This page is educational material, not financial advice. The figures come from the formula shown and assume the inputs you enter hold for the whole term. Your own rate, fees, taxes and timing will differ, so treat the output as arithmetic to check a decision against, not as a recommendation.