Capital Gains Tax Calculator

Last updated: 2026-09-01

Capital Gains Tax Calculator — Capital Gains Tax Calculator. Free online calculator with formula, examples and step-by-step guide.
Inputs
€
€
%
Result
Enter values and press Calculate
Common Examples — Click to Fill
Price CompraSale priceRate Impuesto
Starter 507519
Average 7511219
High 10015019
Premium 15022519
Enterprise 20030019

TL;DR: To calculate capital gains tax, subtract your property’s adjusted cost basis (purchase price plus improvements and closing costs) from its net selling price, then multiply the resulting profit by the applicable short-term (ordinary income) or long-term (0%, 15%, or 20%) tax rate based on your taxable income and holding period.

What Is the Capital Gains Tax Calculator?

The Capital Gains Tax Calculator is a financial planning tool that estimates the federal tax you owe when you sell an asset—such as stocks, bonds, real estate, or collectibles—for more than you originally paid. It does this by processing two fundamental inputs: your total cost basis (what you invested) and your final sale proceeds (what you received). The calculator then applies the correct capital gains tax rate structure based on how long you held the asset and which federal income tax bracket you fall into.

This calculator is essential for investors, homeowners, and small business owners who are preparing to sell an appreciated asset. Whether you are selling a rental property that has doubled in value, liquidating an inherited stock portfolio, or disposing of a startup stake, knowing your estimated tax liability before the sale allows you to negotiate better, plan for quarterly estimated tax payments, and avoid an unexpected bill at filing time. The tool is also crucial for tax-loss harvesting strategies, where you deliberately sell losing assets to offset the gains from winning ones.

The calculator is designed for US taxpayers, as it follows the Internal Revenue Service (IRS) rules for capital gains. It provides immediate outputs: your total taxable gain and your estimated tax owed. This transparency helps you decide whether to hold an asset for at least one year to qualify for lower long-term rates, or whether the short-term gain is acceptable given your current financial situation.

How to Use the Calculator

To get an accurate estimate, follow this simple step-by-step process. The calculator is deliberately straightforward, requiring only three pieces of information.

  1. Enter your Total Cost Basis (in dollars): This is the original purchase price of the asset, plus any capital improvements (for real estate) or reinvested dividends (for stocks). Do not include ongoing maintenance or property taxes. For example, if you bought a property for $200,000 and added a $50,000 extension, your basis is $250,000.
  2. Enter your Sale Proceeds (in dollars): This is the total amount you received from the sale before any deductions for agent commissions, legal fees, or transfer taxes. For stocks, this is your gross sales proceeds. For real estate, this is the contract sale price.
  3. Select your Holding Period: Choose between “Short-Term” (held for 1 year or less) or “Long-Term” (held for more than 1 year). This selection determines which tax rate structure applies to your gain.
  4. Enter your Annual Taxable Income (in dollars): This is your total taxable income from all sources for the year, including wages, interest, dividends, and other business income. This value is used to place you in the correct capital gains tax bracket (0%, 15%, or 20% for long-term gains; your ordinary income tax bracket for short-term gains).
  5. Click “Calculate”: The calculator instantly processes these inputs and displays two key outputs: your Total Capital Gain (Sale Proceeds minus Cost Basis) and your Estimated Tax Owed (the gain multiplied by your applicable rate).

Ensure all monetary figures are entered in US dollars, without commas or dollar signs, to avoid parsing errors. The calculator assumes you are a single filer or uses a simplified joint-rate table; consult a tax professional for complex situations involving trusts or estates.

Formula and Calculation Method

The mathematical core of the calculator is two-step. First, it computes the gross capital gain, and second, it applies the tax rate.

Step 1: Calculate the Capital Gain
Capital Gain = Sale Proceeds – Total Cost Basis

If this number is negative, you have a capital loss, which can be used to offset other gains. If positive, you have a taxable gain.

Step 2: Apply the Tax Rate
Estimated Tax = Capital Gain × Applicable Tax Rate

For short-term gains (assets held ≤ 1 year), the rate is your ordinary federal income tax rate, which ranges from 10% to 37% depending on your taxable income. For long-term gains (assets held > 1 year), the rate is 0%, 15%, or 20%, based on your taxable income thresholds. For 2024, single filers pay 0% on long-term gains up to $47,025; 15% on gains between $47,026 and $518,900; and 20% above $518,900. Married filing jointly thresholds are $94,050 (0%) and $583,750 (20% threshold).

Worked Example:
Imagine you purchased 100 shares of ABC Corp for $5,000 (including commissions). You held them for 14 months and sold them for $9,500. Your cost basis is $5,000 and sale proceeds are $9,500.
Capital Gain = $9,500 – $5,000 = $4,500 (Long-Term Gain because you held for more than 1 year).
If your taxable income is $60,000 (single filer), you fall in the 15% long-term capital gains bracket.
Estimated Tax = $4,500 × 0.15 = $675.
Your net profit after tax is $4,500 – $675 = $3,825.

Practical Examples

To demonstrate the versatility of the calculator, here are three realistic scenarios covering different Asset classes and holding periods.

ScenarioCost BasisSale ProceedsHolding PeriodTaxable IncomeCapital GainTax RateEstimated Tax
Example 1: Short-Term Stock Trade$2,000$2,8006 months$45,000 (single)$80022% (ordinary income)$176
Example 2: Long-Term Rental Property Sale$180,000$310,0008 years$120,000 (joint)$130,00015% (long-term)$19,500
Example 3: Low-Income Retiree Stock Sale$15,000$21,0003 years$30,000 (single)$6,0000% (long-term)$0

In Example 1, the short-term gain is taxed at the investor’s marginal income tax rate, which is significantly higher than long-term rates. Example 2 shows a typical real estate gain where a married couple pays 15% because their taxable income exceeds the 0% threshold but is below the 20% limit. Example 3 illustrates a powerful strategy: a retiree with a modest income can sell long-term assets entirely tax-free if their taxable income stays below $47,025 (single).

Tips for Accurate Results

Even with a simple calculator, accuracy depends entirely on the quality of your inputs. Here are critical tips to avoid common mistakes.

  • Enter values in consistent US dollars: Do not enter amounts in thousands (e.g., “50” for $50,000) or include foreign currency figures. Verify all numbers match your brokerage statement or closing disclosure.
  • Include all allowable cost-basis adjustments: For real estate, remember to add closing costs you paid at purchase (title insurance, recording fees) and capital improvements (new roof, major remodel) to your basis. For stocks, add reinvested dividends and any brokerage commissions charged at purchase.
  • Subtract selling expenses properly: While the calculator asks for “Sale Proceeds,” you may need to reduce this number by commission and settlement fees to get an accurate net gain. If you enter gross proceeds, the calculator will overestimate your tax. For accuracy, input your net proceeds after selling fees.
  • Do not confuse “Taxable Income” with “Gross Income”: Use your IRS Form 1040 line 15 (taxable income), not your total salary. Your taxable income is already reduced by deductions and exemptions, and using a gross figure will push you into a higher capital gains bracket incorrectly.
  • Verify your holding period with precision: The 1-year mark is calculated to the exact day. If you bought on June 1, 2023, and sold on June 1, 2024, you have held for one year exactly—this qualifies as long-term. Selling on May 31, 2024, would be short-term. Check trade confirmation dates, not settlement dates.
  • Remember Medicare surtaxes: The calculator estimates federal capital gains tax only. If your modified adjusted gross income exceeds $200,000 (single) or $250,000 (joint), you must add a 3.8% Net Investment Income Tax (NIIT) to your gain. This calculator does not include NIIT, so mentally add that amount for high earners.

Avoid the common pitfall of using default values without verification. If the calculator pre-fills a typical basis or default income, replace those figures with your actual data. Misestimating basis by even $5,000 can result in a $750 tax error at the 15% rate.

Frequently Asked Questions

1. Do I have to pay capital gains tax if I reinvest the proceeds into another property?

Not under standard IRS rules. The “1031 exchange” allows you to defer capital gains tax on investment properties if you reinvest the proceeds into a like-kind property within 180 days using a qualified intermediary. However, this does not apply to your primary residence or to stocks. For a primary home, you can exclude up to $250,000 of gain (or $500,000 for married couples) if you have owned and lived in the home for at least two of the five years before the sale. If you qualify for this primary residence exemption, your capital gain may be entirely tax-free, and the calculator would show $0 for your tax liability. For investment properties, you must use a 1031 facilitator; simply buying another property later does not defer the tax.

2. What is the difference between short-term and long-term capital gains tax rates in 2024?

Short-term capital gains (assets held for one year or less) are taxed as ordinary income, meaning they are added to your wages and taxed at your marginal income tax rate—which ranges from 10% to 37%. Long-term capital gains (assets held for more than one year) are taxed at preferential rates: 0% for taxable income up to $47,025 (single) or $94,050 (married joint); 15% for income from $47,026 to $518,900 (single) or $94,051 to $583,750 (joint); and 20% for income above those thresholds. The difference is dramatic: a single taxpayer earning $100,000 would pay 24% on a short-term gain, but only 15% on the same gain if held long-term. This 9-percentage-point difference incentivizes holding assets longer.

3. Can I use capital losses to reduce my capital gains tax?

Yes, strategically. If your calculator inputs show a capital loss (sale proceeds lower than cost basis), you can use that loss to offset capital gains from other sales. For example, if you sell Stock A for a $10,000 gain and Stock B for a $4,000 loss, your net gain is $6,000, and you only pay tax on $6,000. If your total capital losses exceed your capital gains, you can deduct up to $3,000 of the remaining loss against your ordinary income each year ($1,500 if married filing separately). Any unused capital loss carries forward indefinitely to future tax years. To use this with the calculator, adjust your “Sale Proceeds” figure to reflect your net gain after offsetting losses, or calculate separate gains and subtract losses manually before running the calculator.

FAQ

What types of assets does the Capital Gains Tax Calculator support?

The calculator supports a wide range of capital assets, including stocks, bonds, real estate, mutual funds, and cryptocurrencies. It also allows you to specify the purchase and sale dates to automatically determine whether the gain is short-term or long-term, which affects the applicable tax rate.

How does the calculator handle different tax rates based on income brackets?

The calculator uses your taxable income and filing status (single, married filing jointly, etc.) to determine the correct capital gains tax rate, which ranges from 0% to 20% for long-term gains and aligns with ordinary income tax rates for short-term gains. You can input your income manually or use the built-in IRS tax bracket tables for the current year to ensure accuracy.

Can I account for capital losses and netting them against gains?

Yes, the calculator allows you to enter both capital gains and capital losses from multiple transactions. It will automatically net your total gains and losses, applying the $3,000 annual deduction limit for net capital losses (or $1,500 if married filing separately), and carry over any unused losses to future years as required by IRS rules.

Does the calculator include state-level capital gains taxes?

By default, the calculator focuses on federal capital gains taxes, but it offers an optional state tax module for states that tax capital gains. You can select your state from a dropdown, and the calculator will apply the state's specific tax rate and rules, such as whether the state conforms to federal treatment of short-term vs. long-term gains, to give you a combined federal and state estimate.