Capital Gains Tax Calculator
Quickly compute capital gains tax with accurate formulas. See amortization schedules, growth projections, and side-by-side comparisons.
Reviewed for accuracy by Sahil, Senior Finance & Tax Editor
Capital Gains Tax Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser — no data is sent to any server.
Formula: Capital Gain = Sale Price - Purchase Price | Long-term (>12mo): 0/15/20% | Short-term (≤12mo): Ordinary income rate
Worked example — $750 tax, $4,250 net
Formula
Capital Gain = Sale Price - Purchase Price | Long-term (>12mo): 0/15/20% | Short-term (≤12mo): Ordinary income rate
Long-term capital gains (held >12 months) are taxed at 0%, 15%, or 20% depending on income. Short-term gains are taxed as ordinary income.
Worked Examples
Example 1: Stock sale
Problem:Buy $10K, sell $15K after 18 months, 22% bracket
Solution:Gain=$5K, long-term, 15% rate → Tax=$750, Net=$4,250
Result:$750 tax, $4,250 net
Frequently Asked Questions
What qualifies as long-term?
Assets held more than 12 months qualify for lower long-term capital gains rates (0%, 15%, or 20%). Under 12 months = short-term, taxed as ordinary income.
What are the 2024 long-term capital gains tax rates?
For 2024, long-term capital gains rates are 0% for single filers with taxable income up to $47,025 and married filing jointly up to $94,050; 15% for single filers earning $47,026 to $518,900 and married up to $583,750; and 20% for income above those thresholds. High-income earners also pay an additional 3.8% Net Investment Income Tax (NIIT) on gains if their modified adjusted gross income exceeds $200,000 (single) or $250,000 (married), effectively making the top rate 23.8%.
Can I use capital losses to offset capital gains?
Yes. Capital losses directly offset capital gains dollar for dollar. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains, before crossing over. If your losses exceed your gains, you can deduct up to $3,000 of net capital losses against ordinary income per year. Any losses beyond $3,000 are carried forward to future tax years indefinitely. This tax-loss harvesting strategy is commonly used by investors near year-end to sell losing positions to offset gains realized earlier in the year.
How are capital gains taxed differently for real estate?
For your primary residence, the IRS allows a capital gains exclusion of up to $250,000 (single) or $500,000 (married filing jointly) if you have owned and lived in the home for at least 2 of the 5 years before the sale. For investment real estate, long-term gains are taxed at 0%, 15%, or 20%, but depreciation taken during ownership is recaptured at a 25% rate. Real estate investors may also defer capital gains through a 1031 exchange by reinvesting proceeds into another investment property within 180 days of the sale.
What's the difference between short-term and long-term capital gains, and why does the holding period matter so much?
Assets held one year or less generate short-term capital gains, taxed at your ordinary income tax rate — potentially as high as the top marginal bracket. Assets held for more than one year qualify for long-term capital gains treatment, taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income, which can be dramatically lower than your ordinary rate. Holding an appreciated asset just a bit longer to cross the one-year mark can meaningfully reduce the tax owed on the same dollar gain.
Can capital losses offset capital gains, and how much excess loss can I deduct against ordinary income?
Capital losses first offset capital gains of the same type (short-term losses against short-term gains, long-term against long-term), with any remaining net loss then offsetting the other type. If total losses still exceed total gains, up to a set annual limit (commonly $3,000, $1,500 if married filing separately) can be deducted against ordinary income, with any further excess carried forward to future tax years indefinitely.
What is the Net Investment Income Tax and who has to pay it?
The Net Investment Income Tax (NIIT) is an additional 3.8% surtax on net investment income — including capital gains, dividends, and interest — for taxpayers whose modified adjusted gross income exceeds set thresholds (commonly $200,000 for single filers, $250,000 for married filing jointly, not indexed for inflation). It applies on top of standard capital gains tax rates for higher-income investors.
How are capital gains on the sale of a primary home taxed differently from investment property?
Sellers of a primary residence who meet ownership and use tests (generally living in the home 2 of the last 5 years) can exclude up to $250,000 of gain ($500,000 for married couples filing jointly) from capital gains tax entirely. Investment or rental properties don't qualify for this exclusion and are also subject to depreciation recapture, taxed at a different rate on the portion of gain attributable to prior depreciation deductions.
Do I owe capital gains tax on investments held inside a 401(k) or IRA?
No — trades made inside a traditional 401(k) or IRA don't trigger capital gains tax at the time of sale; instead, withdrawals from a traditional account are taxed as ordinary income when taken out in retirement, regardless of whether the underlying gains came from capital appreciation, dividends, or interest. Roth accounts go a step further, with qualified withdrawals avoiding tax entirely.
Reviewed for accuracy by Sahil, Senior Finance & Tax Editor · Editorial policy
Related Calculators
🧮Crypto Capital Gains Tax Calculator
Calculate short-term and long-term capital gains tax on cryptocurrency trades and estimate your crypto tax liability.
🧮Tax-Loss Harvesting Calculator
Calculate potential tax savings from harvesting investment losses against capital gains.
🧮Salary Tax Take-Home Pay Calculator
Calculate salary tax take home with inputs, formulas, and instant results.
🧮Rental Income Tax Calculator — Deductions Included
Calculate tax on rental income after deducting mortgage interest, depreciation, and expenses.
🧮Tax Withholding Calculator
Calculate the right federal tax withholding from pay frequency, filing status, and allowances.
🧮Hourly to Salary Converter with Overtime
Calculate hourly to salary converter with inputs, formulas, and instant results.
🧮Tax Bracket Estimator with Deductions
Estimate your federal tax liability after standard or itemized deductions, with effective tax rate and take-home pay.
🧮Property Tax Calculator
Calculate property tax with inputs, formulas, and instant results.