Capital Gains Tax Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Estimate capital gains tax before selling an appreciated asset

A sale of stock, real estate, cryptocurrency, or another appreciated asset can create a capital gain, but the sale price alone does not determine the tax estimate. This Capital Gains Tax Calculator starts with a specific transaction: purchase price, sale price, costs on both sides of the sale, loss carryovers, a home-sale exclusion, and the holding period. It then estimates taxable gain, federal tax using the selected short- or long-term rate, optional state tax, and the proceeds remaining after selling expenses and estimated tax.

Tax planning workspace with investment notes, forms, calculator, and capital gain figures.
A capital-gains estimate depends on adjusted basis, selling costs, holding period, exclusions, loss carryovers, income assumptions, and any state rate entered.

Use this capital-gains estimate to compare sale timing or review the effect of costs and carryovers before a transaction. It is an educational planning tool rather than a completed tax return; your actual tax depends on your full return and applicable law.

What a capital gain means for an asset sale

For a capital-gains sale, a capital gain is the amount by which net sale proceeds exceed your adjusted basis. Capital assets can include stocks, ETFs, mutual funds, bonds, rental property, a primary home, cryptocurrency, and collectibles.

For the transaction entered here:

  • You have a capital gain when net sale proceeds are greater than the adjusted amount invested after eligible costs and improvements.
  • You have a capital loss when net sale proceeds are less than that adjusted investment.

Capital-gains treatment can differ from wage income. This calculator classifies a gain as short-term or long-term from the holding period, then uses the corresponding federal rate selection for its estimate.

Capital gains tax formulas used by this calculator

This Capital Gains Tax Calculator follows the transaction sequence used in its results: it determines adjusted basis and net proceeds, finds the gain, applies the entered exclusion and loss carryover, and estimates tax on the remaining taxable gain.

  1. Compute your adjusted basis.
  2. Compute net proceeds from the sale.
  3. Find the capital gain or loss.
  4. Apply the entered home-sale exclusion and loss carryover.
  5. Apply the selected federal rate and any entered state rate.

Capital-gains adjusted basis

For this calculator, adjusted basis is the original purchase price plus the purchase expenses or improvements you enter.

In plain notation:

Adjusted basis = Purchase price + Purchase expenses / improvements

Capital-gains net proceeds

Capital-gains net proceeds are the sale price after selling costs such as broker commissions, real-estate commissions, and transfer fees have been deducted.

Net proceeds = Sale price - Selling expenses

Capital gain before entered adjustments

The calculator's preliminary capital gain or loss is:

Gain = NetProceeds AdjustedBasis

Taxable capital gain after adjustments

For a positive gain, the calculator first applies the home-sale exclusion amount entered and then applies the capital loss carryover entered. It never reports a taxable gain below zero.

Taxable gain = max( 0, Gain - Home sale exclusion - Loss carryover )

Estimated capital-gains tax owed

The calculator estimates tax by multiplying taxable gain by the federal rate selected for the holding period and adding the entered state rate:

Tax = TaxableGain × ( r + s )

Here, r is the selected federal rate and s is the state rate entered. The form accepts rates as percentages and converts them to decimals for the calculation. This is a single-rate estimate, not a line-by-line tax-return calculation.

How to use this Capital Gains Tax Calculator

To estimate tax on one capital-asset sale, enter the transaction details and the rate assumptions that fit your planning scenario.

  1. Enter purchase information
    • Purchase Price: What you originally paid for the asset.
    • Purchase expenses/improvements: Include broker commissions on purchase, closing costs on a property, and qualifying capital improvements.
    • Purchase date (optional): The date you acquired the asset.
  2. Enter sale information
    • Sale Price: The gross amount you receive when you sell.
    • Selling expenses: Broker commissions, listing fees, escrow fees, transfer taxes, and similar costs.
    • Sale date (optional): The date you sell the asset.
    • Holding period (years): If you do not enter exact dates, enter an approximate holding period. A value at or below one year is treated as short-term; over one year is treated as long-term.
  3. Adjust for special items
    • Capital loss carryover: Prior-year net capital losses you have not yet used on your tax return.
    • Home sale exclusion amount: For a qualifying primary-residence sale, enter the gain amount you expect to exclude.
  4. Enter filing status and income
    • Filing status: Single, Married filing jointly, Married filing separately, or Head of household.
    • Taxable income before this sale: Your estimated taxable income from other sources. The calculator adds taxable gain to this amount when selecting its default federal bracket.
  5. Specify tax rates
    • Short-Term Federal Rate: The calculator can populate its ordinary-income bracket estimate; you may type an override.
    • Long-Term Federal Rate: The calculator can populate its long-term bracket estimate; you may type an override.
    • State tax rate: Your assumed state rate on taxable gain, if applicable.
  6. Run the calculation
    • Click Calculate to view taxable gain, estimated tax, and after-tax proceeds.
    • Use Copy Results to copy the displayed estimate.

Reading a capital gains tax estimate

The capital-gains results trace the sale from gain before adjustments to estimated tax and proceeds after tax. The most useful figures are usually these:

  • Taxable gain after adjustments: the positive gain remaining after the entered home-sale exclusion and capital loss carryover. This is the amount used for the tax estimate.
  • Total tax owed: estimated federal tax plus state tax if a state rate was entered. The combined rate is shown when state tax applies.
  • Net proceeds after tax: sale price less selling expenses and estimated tax. The calculator does not subtract the original purchase cost again because that cost is reflected in the gain calculation rather than in sale proceeds.

When a taxable gain remains, the calculator selects a default federal bracket using filing status and taxable income before the sale plus taxable gain. A typed short-term or long-term rate takes precedence over that default. Because the estimate applies one selected rate to the entire taxable gain, use it to compare scenarios rather than as a substitute for a full bracket-by-bracket tax computation.

If the gain is zero or negative, or if the entered exclusion and carryover eliminate a positive gain, the calculator reports no taxable gain and no tax on that sale. The carryover field is for losses already available to use; it does not calculate netting among additional gains and losses elsewhere in the year.

Useful capital-gains what-if checks include:

  • Compare a holding period at or below one year with one above one year.
  • Test the effect of a different state-rate assumption.
  • Adjust the loss carryover to see how much of the current gain it offsets.

Worked capital gains tax example

This example follows the calculator's simplified one-rate method for a stock sale. Maya bought a position for $12,000 and paid $50 in purchase fees. Two years later, she sells it for $20,000 and pays $100 in selling commissions. She enters a $2,000 capital loss carryover, no home-sale exclusion, a 15% long-term federal rate, and a 5% state rate.

Step-by-step:

  1. Adjusted basis
    • Purchase price: $12,000
    • Purchase expenses: $50
    • Adjusted basis = $12,000 + $50 = $12,050
  2. Net proceeds
    • Sale price: $20,000
    • Selling expenses: $100
    • Net proceeds = $20,000 - $100 = $19,900
  3. Capital gain before adjustments
    • Gain = $19,900 - $12,050 = $7,850
  4. Apply entered adjustments
    • Home sale exclusion: $0
    • Loss carryover: $2,000
    • Taxable gain = $7,850 - $0 - $2,000 = $5,850
  5. Estimate tax
    • Federal long-term rate: 15% (0.15)
    • State rate: 5% (0.05)
    • Total rate = 0.15 + 0.05 = 0.20 (20%)
    • Estimated tax = $5,850 × 0.20 = $1,170
  6. After-tax proceeds
    • Net proceeds: $19,900
    • Estimated tax: $1,170
    • After-tax proceeds = $19,900 - $1,170 = $18,730

Changing the holding period or either rate field lets Maya compare this long-term estimate with a short-term sale scenario.

Comparison of short-term and long-term capital gains

This capital-gains comparison summarizes the holding-period distinction used by the calculator. Actual tax treatment depends on the asset, filing status, taxable income, and current law.

Feature Short-Term Capital Gains Long-Term Capital Gains
Holding period requirement One year or less More than one year
Federal rate used by this tool Selected ordinary-income bracket or typed override Selected long-term bracket or typed override
Common examples Frequent stock trades, crypto trades within a year Long-term investments held for growth, many real estate holdings
Income input in the calculator Added to taxable gain to select the default bracket Added to taxable gain to select the default bracket
Planning question Whether realizing the gain before a year changes the estimate Whether waiting beyond one year changes the estimate

Limits of this capital gains tax estimate

This capital-gains calculator intentionally models one sale with a limited set of inputs. Review these limits before relying on its result for a filing or transaction decision:

  • Not personalized tax advice: Results are estimates only and do not replace advice from a CPA, EA, or other qualified professional.
  • Single-rate federal estimate: The calculator selects one federal rate from its built-in brackets unless you override it, then applies that rate to all taxable gain. It does not calculate portions of a gain across multiple brackets.
  • Single-asset focus: The tool focuses on one sale at a time. It does not automatically net multiple gains and losses across different assets for the same year.
  • Simplified state tax treatment: State tax is modeled as a flat percentage applied to taxable gain. Many states have more complex rules.
  • No special asset classes: It does not explicitly model collectibles tax rates, depreciation recapture, Section 1250 property rules, qualified small business stock exclusions, or other specialized regimes.
  • No wash sale or straddle rules: For stocks and other securities, the calculator does not apply wash sale rules, constructive sales, or straddle rules that can affect basis and recognized loss.
  • No 3.8% Net Investment Income Tax (NIIT): The potential additional surtax on net investment income is not included.
  • No Alternative Minimum Tax (AMT): The tool does not compute AMT or interactions with AMT rules.
  • Home sale exclusion entered manually: For a primary-residence sale, you must enter the exclusion amount yourself. The calculator does not determine eligibility or cap the amount.
  • Approximate holding period: When dates are not entered, the years field provides a planning approximation for the short-term or long-term classification.

Tax rules can change, and an important sale may involve facts outside this model. Verify decisions using current official guidance and a qualified tax professional.

How holding period affects capital gains tax

For this Capital Gains Tax Calculator, the holding period determines whether the gain is estimated as short-term or long-term.

  • Short-term capital gain: An asset held for one year or less. The calculator uses its ordinary-income bracket estimate unless you supply a short-term rate override.
  • Long-term capital gain: An asset held for more than one year. The calculator uses its long-term bracket estimate unless you supply a long-term rate override.

This calculator lets you indicate the capital-asset holding period using either:

  • Purchase date and sale date, or
  • Holding period (years) if you prefer to enter an approximate duration.

If you provide both dates, the calculator calculates and displays the approximate years from those dates. For tax reporting, rely on the applicable legal holding-period rules and transaction dates rather than an estimate alone.

Capital Gains Tax Calculator frequently asked questions

These answers explain the inputs and simplified tax treatment used in this capital-gains estimate.

What does this capital gains tax calculator treat as a gain?

For this estimate, gain is net sale proceeds minus adjusted basis. Net sale proceeds are the sale price less selling expenses, while adjusted basis is the purchase price plus purchase expenses or improvements entered in the calculator. A result below zero is a capital loss rather than a taxable gain.

How does the calculator distinguish short-term and long-term capital gains?

The calculator treats a holding period of more than one year as long-term and a period of one year or less as short-term. It uses the applicable built-in federal bracket as a planning estimate unless you type a federal-rate override. Short-term gains use ordinary-income brackets; long-term gains use the calculator's long-term capital-gains brackets.

How does this calculator arrive at taxable capital gain?

The calculator subtracts selling expenses and adjusted basis from the sale price, then applies the home-sale exclusion entered by the user and any capital loss carryover. Taxable gain is not allowed to fall below zero. It then estimates federal tax using one selected rate and adds any state rate entered by the user.

Sources: Capital-gains rules follow IRS guidance — see IRS Topic No. 409, Capital Gains and Losses. This calculator uses a simplified estimate: taxable gain = max(0, sale − selling expenses − cost basis − entered exclusion − entered loss carryover), with a selected federal rate and any state rate entered.

Enter values and click Calculate.

Click to Play

Hold your sale until long-term windows open and dodge tax shocks.

Score: 0
Best: 0
Tap to hold, release to sell