Stock Capital Gains Tax Calculator
Compute realised gains, loss netting and adjusted basis with AI-powered step-by-step solutions
Gain Is Proceeds Minus Basis
Every capital gains calculation starts with one subtraction:
- Proceeds â shares sale price, less selling commissions and fees
- Cost basis â shares purchase price, plus buying commissions, adjusted for splits, reinvested dividends and any wash-sale disallowance
Tax is then the gain times whatever rate applies to it:
The rate is the part no calculator can supply. Almost every jurisdiction distinguishes gains on assets held a short time from gains on assets held longer, and the thresholds, the rates, the bands and the treatment of losses all differ by country and change from year to year. Frequent trading may also be classified differently from investing.
So the useful division of labour is this: the arithmetic below â basis, gain, netting, adjusted basis â is identical everywhere and is what this page computes. The rate is an input you supply from your own current rules, or from a qualified tax professional. Nothing here is tax advice.
Netting Losses and Wash Sales
The netting order
Gains and losses are combined within each holding-period category first, then across:
- Net short-term:
- Net long-term:
- If one is positive and the other negative, offset them
A remaining net loss may be deductible against ordinary income up to a limit and carried forward â but the limit, the carry-forward period and whether it applies at all are jurisdiction-specific.
Basis when lots differ
Selling part of a position requires identifying which shares went. Specific identification uses the chosen lot's basis; FIFO uses the oldest; average cost is permitted for some assets in some places. The method changes , sometimes dramatically.
Wash sales
Where the rule exists, selling at a loss and repurchasing a substantially identical security inside the window disallows the loss and adds it to the basis of the replacement:
The loss is deferred, not destroyed â it reappears when the replacement shares are sold.
Trading costs
Commissions belong in the basis and proceeds, not deducted separately afterwards.
Common Mistakes to Avoid
- Forgetting commissions in the basis: buying costs raise the basis, selling costs reduce proceeds. Both lower the gain, and both are frequently omitted.
- Ignoring reinvested dividends: each reinvestment is a purchase with its own basis. Leaving them out inflates the gain and taxes the same money twice.
- Netting across categories first: short-term nets against short-term and long-term against long-term before the two are combined. The order changes the result.
- Assuming a loss is deductible immediately: a repurchase inside the wash-sale window defers it into the new basis.
- Applying one rate to a whole year of trading: gains are usually taxed by category, and often by band. A single blended percentage is an estimate at best.
- Using last year's rates: bands and thresholds are revised regularly. Always confirm the current figures for your jurisdiction.
Examples
Frequently Asked Questions
Gain = proceeds â cost basis. Proceeds are shares à sale price less selling costs; basis is shares à purchase price plus buying commissions, adjusted for splits, reinvested dividends and any wash-sale disallowance.
Net within each holding-period category first, then offset the categories against each other if their signs differ. $5,300 of net short-term gain against $3,500 of net long-term loss leaves $1,800. What happens to a remaining net loss depends on your jurisdiction's deduction limit and carry-forward rules.
Where the rule applies, repurchasing a substantially identical security within the prescribed window after selling at a loss disallows that loss for now. It is added to the basis of the replacement shares â new basis = repurchase cost + disallowed loss â so the deduction is deferred, not lost.
Whichever rate applies to you. Capital gains rates depend on the holding period, your total income, and your jurisdiction, and they are revised regularly, so this page deliberately takes the rate as an input rather than assuming one. Confirm your current figures with a qualified tax professional.
Try AI-Math for Free
Get step-by-step solutions to any math problem. Upload a photo or type your question.
Start Solving