Calculate capital gains tax on shares from buy and sell prices and holding period — see gain, tax and net.
Enter values above — results appear automatically, or press Calculate. The formula used is explained below.
Capital gain is sale proceeds minus cost basis, times shares: buying 100 shares at $50 and selling at $80 yields a $3,000 gain. Short-term gains (assets held one year or less) tax as ordinary income at 10–37%; long-term gains (over one year) get preferential 0%, 15% or 20% rates by income — the single biggest lever in this entire topic, worth thousands on typical stock sales.
Cost basis is where most filers err: it's purchase price plus commissions and fees, adjusted for splits, dividends reinvested (each reinvestment raises basis), wash-sale deferrals and gifted/inherited step-ups. Broker 1099-B figures are usually right for covered shares but pre-2011 lots, transfers and crypto require manual reconstruction — wrong basis means wrong tax.
Loss harvesting turns losers into assets: realized losses offset gains dollar-for-dollar, plus up to $3,000 yearly against ordinary income, with excess carried forward indefinitely. December selling of losers while deferring winners into January is textbook timing; wash-sale rules (repurchasing substantially identical securities within 30 days) defer — not destroy — the loss, so mind the window.
State taxes stack on top: 0% in Texas/Florida/Washington, 13.3% in California — a 15% federal long-term rate becomes 28.3% combined in California. High earners also face the 3.8% Net Investment Income Tax above MAGI thresholds ($200k single/$250k joint). Enter your combined rate here for the honest number.
Holding-period planning beats rate shopping: one day past the one-year mark can halve the rate (37% to 20% at top brackets). Before selling, check the acquisition anniversary; employee stock (RSUs vest as income, ISOs/ESPPs carry qualifying-disposition rules) and crypto (same capital rules, no wash-sale rule currently — a loophole Congress revisits) each add wrinkles worth professional review.
This is a planning estimate, not tax advice. State regimes, NIIT thresholds, AMT interactions and special assets (collectibles 28%, Section 1202 QSBS exclusions, Opportunity Zones) all shift real liability — confirm material sales with a CPA.
Holding period is the single biggest number in the calculation, and it is not the same as the date on the statement. Assets bought and sold within a year are short-term and taxed at your ordinary rate; a year or more is long-term and taxed at the preferential rate, so the difference is often the entire result. The clock runs from acquisition, which is why a stock bought in March and sold the following March crosses into long-term even if the price barely moved, and why wash-sale rules make the near-boundary case impossible to time casually — buying the same security within 30 days of a sale can disallow the loss on the earlier one.
Cost basis is all-or-nothing across the same lot only if you sell an entire lot; in practice brokers sell shares FIFO, so which shares leave the account is a policy, not a preference. That makes the tax result partly an artifact of account history. Lots bought at very different prices produce very different gains on the same sale, and a tax-aware investor who wants a specific number should check which lot the broker will use before placing the order rather than after seeing the form.
Losses cap against gains, and that asymmetry is the part people plan badly. Capital losses offset capital gains without limit in the same direction, but only $3,000 of net loss can offset ordinary income per year, and the rest carries forward indefinitely. A large loss therefore only becomes usable against a future gain or against a small slice of current income, which is why 'I lost money so it cancels my tax bill' is usually wrong by a wide margin and why realising a loss in a losing year is frequently a mistake.
Calculate capital gains tax on shares from buy and sell prices and holding period — see gain, tax and net. Formula: Gain = (sell-buy)*shares. Example: Buy 100 at $50, sell at $80: gain $3,000.
Capital gain is sale proceeds minus cost basis, times shares: buying 100 shares at $50 and selling at $80 yields a $3,000 gain. Short-term gains (assets held one year or less) tax as ordinary income at 10–37%; long-term gains (over one year) get preferential 0%, 15% or 20% rates by income — the single biggest lever in this entire topic, worth thousands on typical stock sales.
Cost basis is where most filers err: it's purchase price plus commissions and fees, adjusted for splits, dividends reinvested (each reinvestment raises basis), wash-sale deferrals and gifted/inherited step-ups. Broker 1099-B figures are usually right for covered shares but pre-2011 lots, transfers and crypto require manual reconstruction — wrong basis means wrong tax.
Loss harvesting turns losers into assets: realized losses offset gains dollar-for-dollar, plus up to $3,000 yearly against ordinary income, with excess carried forward indefinitely. December selling of losers while deferring winners into January is textbook timing; wash-sale rules (repurchasing substantially identical securities within 30 days) defer — not destroy — the loss, so mind the window.
State taxes stack on top: 0% in Texas/Florida/Washington, 13.3% in California — a 15% federal long-term rate becomes 28.3% combined in California. High earners also face the 3.8% Net Investment Income Tax above MAGI thresholds ($200k single/$250k joint). Enter your combined rate here for the honest number.
Holding-period planning beats rate shopping: one day past the one-year mark can halve the rate (37% to 20% at top brackets). Before selling, check the acquisition anniversary; employee stock (RSUs vest as income, ISOs/ESPPs carry qualifying-disposition rules) and crypto (same capital rules, no wash-sale rule currently — a loophole Congress revisits) each add wrinkles worth professional review.
This is a planning estimate, not tax advice. State regimes, NIIT thresholds, AMT interactions and special assets (collectibles 28%, Section 1202 QSBS exclusions, Opportunity Zones) all shift real liability — confirm material sales with a CPA.
Holding period is the single biggest number in the calculation, and it is not the same as the date on the statement. Assets bought and sold within a year are short-term and taxed at your ordinary rate; a year or more is long-term and taxed at the preferential rate, so the difference is often the entire result. The clock runs from acquisition, which is why a stock bought in March and sold the following March crosses into long-term even if the price barely moved, and why wash-sale rules make the near-boundary case impossible to time casually — buying the same security within 30 days of a sale can disallow the loss on the earlier one.
Cost basis is all-or-nothing across the same lot only if you sell an entire lot; in practice brokers sell shares FIFO, so which shares leave the account is a policy, not a preference. That makes the tax result partly an artifact of account history. Lots bought at very different prices produce very different gains on the same sale, and a tax-aware investor who wants a specific number should check which lot the broker will use before placing the order rather than after seeing the form.
Losses cap against gains, and that asymmetry is the part people plan badly. Capital losses offset capital gains without limit in the same direction, but only $3,000 of net loss can offset ordinary income per year, and the rest carries forward indefinitely. A large loss therefore only becomes usable against a future gain or against a small slice of current income, which is why 'I lost money so it cancels my tax bill' is usually wrong by a wide margin and why realising a loss in a losing year is frequently a mistake.
Buy 100 at $50, sell at $80: gain $3,000. Long-term at 15% federal: tax $450, net $2,550. In California add 13.3% ($399) for $849 total; a short-term seller at 32% pays $960 federal alone — holding period was worth $510 here.
Last reviewed: September 2026 · Report an error