HomeCalculatorsFinance & InvestmentCapital Gains Tax Calculator

Capital Gains Tax Calculator

Finance & Investment

Calculate your US federal capital gains tax using 2025 IRS rates. Covers short and long-term gains for single, married, and head-of-household filers.

Purchase Price (Cost Basis)
$
Sale Price
$
Annual Ordinary Income
$
Holding Period
Filing Status

Capital Gain

+$0

Applicable Tax Rate0.00%
Federal Tax Owed$0
Net Proceeds After Tax$0

Rates shown are 2025 federal rates. State capital gains taxes are additional. NIIT (3.8%) may apply if your income exceeds $200K (single) or $250K (married).

What is a Capital Gains Tax?

A Capital Gains Tax Calculator computes your estimated federal tax liability when you sell an appreciated asset — stocks, ETFs, mutual funds, real estate, cryptocurrency, or any other capital asset. It applies 2025 IRS tax rates to show you exactly how much of your sale proceeds will go to federal taxes and how much you keep as net proceeds.

Capital gains taxes in the US have two tracks based entirely on how long you held the asset. Short-term gains — on assets held one year or less — are taxed at your ordinary marginal income rate, which can reach 37%. Long-term gains — on assets held more than one year — are taxed at preferential rates of 0%, 15%, or 20%, depending on your taxable income. The difference between these two rates can be enormous: a $50,000 gain taxed at 37% costs $18,500; that same gain taxed at 15% costs $7,500 — a $11,000 swing based purely on whether you held the asset one extra day past the one-year mark.

For high-income taxpayers, the 3.8% Net Investment Income Tax (NIIT) applies on top of the standard capital gains rates, raising the effective maximum rate to 23.8% (long-term) or 40.8% (short-term, including ordinary income rates). The NIIT threshold — $200,000 for single filers, $250,000 for married filing jointly — has not been adjusted for inflation since the tax was introduced in 2013.

Understanding your capital gains tax before you sell helps you make better decisions: whether to wait until an asset crosses the one-year holding threshold, whether to harvest offsetting losses in the same tax year, or whether to use tax-advantaged accounts for higher-growth positions. For long-term tax-free growth, the Roth vs Traditional IRA Calculator models how keeping gains inside a Roth IRA eliminates capital gains taxes entirely.

How to use this Capital Gains Tax calculator

  1. Enter your Purchase Price — the original cost basis of the asset. For stocks, this is your purchase price per share times number of shares. For real estate, include purchase price plus closing costs and capital improvements. For crypto, include the price plus exchange fees paid.

  2. Enter your Sale Price — the proceeds from the sale. For stocks and crypto, use the proceeds after any exchange or brokerage fees. For real estate, use the gross sale price before closing costs (closing costs reduce your gain separately).

  3. Select Holding Period — "Short-term" for assets held one year or less, "Long-term" for assets held more than one year. This is the most consequential single input — it determines whether you pay ordinary or preferential rates.

  4. Select your Filing Status — choose Single, Married Filing Jointly, or Head of Household. This determines which income thresholds apply to each capital gains rate bracket.

  5. Enter your Ordinary Income — your estimated taxable income from non-capital-gains sources for the current year. This positions your capital gain on the tax bracket stack. If uncertain, use your taxable income from last year's Form 1040 (line 15) as a starting estimate.

  6. Review the four outputs — confirm the Capital Gain is what you expected. Check the Tax Rate to see if you are in the NIIT zone. Use Tax Owed to make your sell / hold decision. Note Net Proceeds for reinvestment planning.

Formula & Methodology

Capital Gain:

Capital Gain = Sale Price − Purchase Price

Short-term capital gains tax (ordinary income rates, 2025, single):

Tax owed = Marginal tax on (Ordinary Income + Capital Gain) − Marginal tax on Ordinary Income

Where marginal tax is computed using 2025 ordinary income brackets: 10% / 12% / 22% / 24% / 32% / 35% / 37%.

Long-term capital gains rate (2025):

Taxable income = Ordinary Income + Capital Gain

| Filing Status | 0% threshold | 15% threshold | 20% threshold |
|---|---|---|---|
| Single | ≤ $48,350 | ≤ $533,400 | > $533,400 |
| Married / Joint | ≤ $96,700 | ≤ $600,050 | > $600,050 |
| Head of Household | ≤ $64,750 | ≤ $566,700 | > $566,700 |

The rate applies to the capital gain portion above the ordinary income. If $30,000 of ordinary income straddles the 0% and 15% thresholds, the gain is split accordingly.

NIIT (Net Investment Income Tax):

NIIT applies at 3.8% on the lesser of:
- Net investment income (including capital gains), or
- MAGI − $200,000 (single) / $250,000 (married filing jointly)

Net Proceeds:

Net Proceeds = Sale Price − Tax Owed

Worked example:

Single filer, ordinary income $60,000, purchased stock for $20,000 three years ago, sold for $50,000 (long-term gain of $30,000).

Taxable income = $60,000 + $30,000 = $90,000

Long-term rate at $90,000 (single): above $48,350 → 15% bracket

Tax owed (LTCG) = $30,000 × 15% = $4,500

NIIT check: $90,000 < $200,000 → no NIIT

Net Proceeds = $50,000 − $4,500 = $45,500

Now compare with selling after only 10 months (short-term):

Ordinary income bracket at $90,000: 22% marginal rate

Short-term tax = $30,000 × 22% = $6,600

Net Proceeds = $50,000 − $6,600 = $43,400

Waiting the full year saves $2,100 on this transaction.

Key assumptions: The calculator computes federal capital gains tax only — it does not include state income taxes (which can add 0–13.3% depending on your state), the primary residence exclusion, depreciation recapture on real estate, or wash sale rule adjustments. Always verify with a tax professional before making large asset sales.

Frequently Asked Questions

The Capital Gains Tax Calculator computes your federal capital gains tax liability when you sell an asset — such as a stock, ETF, mutual fund, or real estate — based on your purchase price, sale price, holding period, filing status, and ordinary income. It applies 2025 IRS short-term and long-term capital gains rates, including the 3.8% Net Investment Income Tax (NIIT) for high earners, and shows your net proceeds after tax.
Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income marginal rate — the same rate as wages, which can be as high as 37% in 2025. Long-term capital gains apply to assets held for more than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income. Holding an appreciated asset for just one day past the one-year mark can save you thousands of dollars in federal taxes.
For 2025, long-term capital gains rates are 0% for single filers with taxable income up to $48,350, 15% up to $533,400, and 20% above $533,400. For married filing jointly, the 0% rate applies up to $96,700, 15% up to $600,050, and 20% above that. The 3.8% Net Investment Income Tax (NIIT) applies on top of these rates for high earners — it kicks in when modified adjusted gross income exceeds $200,000 (single) or $250,000 (married), potentially raising the effective rate to 23.8%.
The Net Investment Income Tax is an additional 3.8% federal tax on investment income for high-income taxpayers. It applies to the lesser of your net investment income (including capital gains, dividends, and interest) or the amount by which your modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married filing jointly. These NIIT thresholds are not adjusted for inflation and have not changed since the tax was introduced in 2013, meaning more taxpayers are affected each year.
Capital losses can offset capital gains dollar for dollar, reducing your taxable gain. If your capital losses exceed your capital gains, you can deduct up to $3,000 of the net loss against ordinary income per year. Any remaining loss carries forward to future tax years indefinitely. The calculator shows $0 tax owed for transactions resulting in a loss and displays the net loss amount, but modeling the full loss carryforward benefit requires your complete tax situation.
Filing status determines which income thresholds apply to each capital gains rate bracket. Single filers have lower thresholds than married filing jointly, meaning they reach the 15% and 20% brackets at lower income levels. Head of household filers have thresholds that fall between single and married filing jointly. The calculator supports single, married filing jointly, and head of household — choosing the correct status significantly affects whether your long-term gain is taxed at 0%, 15%, or 20%.
The basic calculation is the same — long-term gains on property held more than one year are taxed at 0%, 15%, or 20% rates. However, real estate has additional rules: the $250,000 / $500,000 primary residence exclusion (Section 121) can eliminate tax entirely on gains from selling your main home. Depreciation recapture on rental or business property is taxed at up to 25% as ordinary income. The calculator does not model the primary residence exclusion or depreciation recapture — it computes the capital gains on the sale price minus purchase price.
Yes — the IRS treats cryptocurrency as property, so the same capital gains rules apply. Holding Bitcoin or any other crypto for more than one year before selling qualifies the gain for long-term rates. The purchase price (cost basis) is what you paid for the crypto, including exchange fees; the sale price is the proceeds minus fees. The calculator uses the same formula regardless of the asset type. For frequent crypto traders with many transactions, you would need to calculate each transaction separately and sum the results.
Ordinary Income in the calculator refers to your taxable income from non-capital-gains sources — wages, salary, business income, IRA distributions, Social Security (taxable portion), and other ordinary income items. This figure determines where you fall within the capital gains brackets. Even if your ordinary income is low, the capital gain is stacked on top of it when determining your rate. For example, if your ordinary income is $40,000 (single) and you have a $20,000 long-term gain, the gain falls at the bottom of the 15% LTCG bracket.
Short-term capital gains are added to your ordinary income and taxed at your marginal ordinary income rate. The calculator uses the 2025 ordinary income brackets: 10% up to $11,925 for single filers, 12% up to $48,475, 22% up to $103,350, 24% up to $197,300, 32% up to $250,525, 35% up to $626,350, and 37% above that (single, 2025). The tax owed equals the marginal tax on (ordinary income + capital gain) minus the marginal tax on ordinary income alone — so only the gain portion is taxed at the marginal rate.
The wash sale rule prevents you from claiming a capital loss if you buy the same or substantially identical security within 30 days before or after the sale. If a wash sale applies, the disallowed loss is added to the cost basis of the repurchased shares rather than being deducted in the current year. This calculator does not model the wash sale rule — it computes tax on your stated gain or loss. If a wash sale applies to your transaction, your actual deductible loss may be zero or reduced.
Common strategies include: holding assets for more than one year to qualify for long-term rates; tax-loss harvesting — selling losing positions to offset gains; asset location — placing high-growth assets in Roth IRAs where gains are tax-free (see the [Roth vs Traditional IRA Calculator](/roth-vs-traditional-ira-calculator-us/) to model tax-free growth); timing the sale in a year with lower ordinary income to use the 0% LTCG bracket; and making Qualified Opportunity Zone investments to defer and potentially reduce gains on reinvested proceeds.
Also known as
capital gains tax calculatorlong term capital gains calculatorshort term capital gains taxstock gains tax calculatorinvestment tax calculatorCGT calculator