Home › Calculators › Capital Gains Calculator

Capital Gains Calculator

Find the gain or loss on a sale of stocks, funds, crypto or other assets, then estimate the tax with your own short-term and long-term rates. Dates decide the holding period automatically.

Last updated:

Purchase & sale
$
$

Use 1 for a single asset like a property.

$

Commissions, closing costs; they reduce the gain.

Holding period
Holding period
Your tax rates
%

Often your ordinary income rate.

%

US federal: 0%, 15% or 20%.

%

Added to either rate, e.g. 3.8% NIIT.

Enter your values to see the result.
Advertisement
Advertisement

How to use the Capital Gains Calculator

  1. Enter the purchase and sale price per unit and the quantity.
  2. Add total fees such as commissions; they lower the taxable gain.
  3. Enter the dates or pick the holding period directly.
  4. Enter your short-term and long-term tax rates and any extra rate (state tax, surtax).
  5. Calculate to see the gain, the tax estimate, net proceeds and return.

Capital gains formulas

  • Cost basis = purchase price × quantity + fees
  • Proceeds = sale price × quantity
  • Capital gain = proceeds − cost basis
  • Tax = gain × (short-term or long-term rate + extra rate)
  • Return = gain ÷ cost basis × 100; annualized = (proceeds ÷ basis)1/years − 1

2025 US federal long-term capital gains rates

Long-term rates depend on taxable income (IRS Rev. Proc. 2024-40). Short-term gains are taxed as ordinary income.

RateSingleMarried filing jointlyHead of household
0%up to $48,350up to $96,700up to $64,750
15%$48,351 – $533,400$96,701 – $600,050$64,751 – $566,700
20%over $533,400over $600,050over $566,700

A 3.8% net investment income tax may also apply above $200,000 of modified AGI for single filers ($250,000 married filing jointly). State tax rules vary.

Ways people legally reduce capital gains tax

  • Hold for more than a year to qualify for long-term rates.
  • Harvest losses: sell losing positions to offset gains (watch the 30-day wash-sale rule).
  • Use tax-advantaged accounts where gains are tax-deferred or tax-free.
  • Track your basis, including reinvested dividends and fees, so you do not overpay.

Frequently asked questions

How is a capital gain calculated?

Capital gain = sale proceeds − cost basis. The cost basis is what you paid plus purchase fees, and selling fees reduce the proceeds. This calculator adds all fees to the basis, which gives the same gain. Buying 200 shares at $50 and selling at $80 with $20 of fees gives $16,000 − $10,020 = $5,980.

What is the difference between short-term and long-term capital gains?

In the US, assets held for one year or less produce short-term gains, taxed at ordinary income rates. Assets held for more than one year produce long-term gains, taxed at lower federal rates of 0%, 15% or 20% depending on taxable income.

When does an asset become long-term?

The holding period starts the day after you buy. You need to hold it for more than one year, so you must sell after the one-year anniversary of the purchase date. Selling exactly on the anniversary is still short-term.

What tax rate should I enter?

Enter the rates that apply to you: for US federal tax, short-term gains use your marginal income tax bracket and long-term gains 0%, 15% or 20%. Add state tax and, for higher incomes, the 3.8% net investment income tax in the extra field. Other countries have different rules, so enter your own rates.

What happens with a capital loss?

There is no tax on a loss. In the US, losses first offset capital gains; up to $3,000 of net loss a year ($1,500 if married filing separately) can offset ordinary income, and the rest carries forward to later years.

Does this handle the home sale exclusion or depreciation recapture?

No. For a primary residence, US sellers may exclude up to $250,000 of gain ($500,000 for married couples) if they meet the ownership and use tests, and rental property may have depreciation recapture. Subtract the exclusion or adjust the rates yourself.

Is this tax advice?

No. It is an estimate based on the rates you enter. Actual tax depends on your total income, deductions, other gains and losses and local law.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Stock Profit CalculatorStock trade profit and % return after commissions, plus the break-even sell price.Crypto Profit CalculatorCalculate crypto trade profit, ROI and break-even price after buy and sell fees.ROI CalculatorWork out ROI and annualized ROI, and compare up to three investments side by side.Tax Bracket CalculatorTax in each bracket, total tax, marginal and effective rate, with an editable bracket table.Depreciation Recapture CalculatorTax on selling depreciated property: §1250 gain at up to 25%, §1245 recapture and capital gain.Roth Conversion CalculatorShould you convert a traditional IRA to Roth? Compare after-tax values and find the break-even.Seller Financing CalculatorOwner-financed payment, balloon amount, seller interest income and a yearly note schedule.Income Tax CalculatorEstimate US federal income tax after deductions and credits, with effective and marginal rate.Social Security Benefits CalculatorEstimate your monthly Social Security benefit and compare claiming at 62, full age or 70.GST CalculatorAdd or remove GST at any rate, with India CGST/SGST split and AU, NZ and Canada presets.Reverse Sales Tax CalculatorBack out sales tax from a total: pre-tax price and tax amount, one total or a whole list.Salary to Hourly CalculatorConvert hourly, weekly, monthly and yearly pay, with overtime.VAT CalculatorAdd or remove VAT and sales tax with country rate presets.Sales Tax CalculatorAdd sales tax to a price or find the pre-tax price from a total, with US state rates.Commission CalculatorCalculate flat or tiered sales commission and total pay with a base salary.Overtime CalculatorOvertime pay at time and a half or double time, with weekly, monthly and annual totals.Pay Raise CalculatorNew salary after a raise by percent or amount, with hourly, monthly and real (after inflation) figures.Paycheck CalculatorEstimate take-home pay per paycheck from hourly or salary pay, taxes and deductions.Freelance Hourly Rate CalculatorWork out the hourly and day rate you need from income goals, expenses, taxes and time off.Property Tax CalculatorAnnual and monthly property tax from value, assessment ratio, exemptions and % or mill rate.Hourly to Salary CalculatorConvert an hourly wage to annual, monthly, biweekly, weekly and daily pay, with overtime.Bonus Tax CalculatorEstimate take-home pay on a bonus: 22% federal supplemental rate, FICA and state tax.Self-Employment Tax CalculatorCalculate Social Security and Medicare self-employment tax (15.3%) and the deductible half.Real Estate Commission CalculatorCalculate realtor commission, the agent and broker split, and the seller's net proceeds.Holiday Pay CalculatorWork out pay for holiday hours at 1.5x, 2x or any multiplier, plus total gross pay.Job Offer Comparison CalculatorCompare up to 3 job offers by total compensation, commute, PTO and effective hourly rate.Per Diem CalculatorCalculate a travel per diem from trip dates, lodging and M&IE rates and provided meals.Prorated Salary CalculatorProrated pay for a partial month or year by calendar days or working days, with the daily rate.Quarterly Estimated Tax CalculatorQuarterly estimated tax payments and a due-date schedule for freelancers and the self-employed.Gross Up CalculatorFind the gross amount needed so a bonus or payment leaves the exact net after taxes.Raise vs Inflation CalculatorCheck whether your raise beat inflation: real raise and purchasing power gain or loss.Severance Pay CalculatorEstimate your severance package from salary, years of service, PTO and bonus.Shift Differential CalculatorFind your night or weekend differential rate and weekly gross pay, with FLSA overtime.Tax Equivalent Yield CalculatorCompare tax-free municipal bond yields with taxable yields using your tax rates.Tip Pooling CalculatorSplit a tip pool among staff by hours, role points or percentages, with a tip-out sheet.Arizona Paycheck CalculatorArizona take-home pay: federal tax, FICA and the A-4 state withholding rate you choose.California Paycheck CalculatorCalifornia take-home pay after federal and CA income tax, Social Security, Medicare and SDI.Child Tax Credit CalculatorEstimate your child tax credit, refundable part and income phase-out for 2026 or 2025.401(k) Early Withdrawal CalculatorSee the 10% penalty, taxes, cash you keep and lost growth from cashing out a 401(k) early.How Much to Save for Taxes CalculatorPercentage of each 1099 payment to save for self-employment, federal and state taxes.GS Pay CalculatorFederal GS salary from grade, step and locality: annual, biweekly and hourly pay.Home Office Deduction CalculatorCompare the simplified ($5/sq ft) and regular home office deduction, plus depreciation.Home Sale Capital Gains Tax CalculatorTaxable gain and tax on selling your home after the $250,000 / $500,000 exclusion.Labor Cost CalculatorJob labor cost from crew size, hours, wage, overtime and burden, with cost per labor hour.LLC vs S Corp Tax CalculatorCompare LLC self-employment tax with an S corp salary, payroll taxes and costs: yearly savings.Military Pay CalculatorUS military base pay by grade and years of service, plus BAH, BAS and tax-free totals.Minimum Wage by State CalculatorLook up the 2026 minimum wage in any state and see weekly, monthly and yearly earnings.No Tax on Overtime CalculatorEstimate the federal deduction for qualified overtime premium pay and your tax savings.No Tax on Tips CalculatorEstimate the federal tips deduction (up to $25,000) after the MAGI phase-out and your tax savings.Payroll Tax Calculator (Employer)Employer payroll tax cost: FICA match, FUTA and SUTA per employee, per year and per pay period.Pension CalculatorDefined benefit pension: service × multiplier × final average salary, early reduction, COLA.Real Hourly Wage CalculatorFind your true pay per hour after taxes, commute time and costs, and unpaid work hours.Rideshare Driver Earnings CalculatorFind a rideshare or delivery driver's net pay per hour and per mile after fuel and car costs.RSU Tax CalculatorRSU vest income, 22%/37% withholding vs. your real bracket, tax shortfall and shares withheld.Social Security Break-Even CalculatorCompare claiming Social Security at 62, full retirement age or 70 and find your break-even ages.Total Compensation CalculatorAdd salary, bonus, equity, 401(k) match and benefits to see total comp and effective hourly value.After-Tax Return CalculatorInvestment return after taxes on interest, dividends and gains: taxable vs traditional vs Roth.AMT CalculatorAlternative minimum tax estimate with ISO bargain element, SALT add-back and phase-out.Charitable Donation Tax Deduction CalculatorHow much a donation saves on taxes and what it really costs you after the deduction.Colorado Paycheck CalculatorColorado take-home pay: federal tax, FICA, 4.4% state tax, FAMLI premium and Denver OPT.Child and Dependent Care Credit CalculatorDaycare tax credit by AGI and care costs for 2026 or 2025, compared with a dependent care FSA.Education Tax Credit CalculatorAmerican Opportunity vs Lifetime Learning credit from tuition, MAGI and filing status.Estate Tax CalculatorEstimate US federal estate tax: gross estate, deductions, gifts, exemption and portability.Gift Tax CalculatorAnnual exclusion, gift splitting, lifetime exemption, Form 709 check and gift tax due.Indiana Paycheck CalculatorIndiana take-home pay after federal tax, FICA, the flat state tax and county income tax.IRS Penalty CalculatorLate filing and late payment penalties plus interest on unpaid federal tax, month by month.Lifetime Earnings CalculatorTotal career earnings from starting salary, growth, career length and breaks, plus per hour.Marriage Penalty CalculatorFederal tax as two singles vs married filing jointly or separately: penalty or bonus.
See all 118 Tax & Paycheck Calculators →