Taxes & Income

Capital Gains Tax Calculator

Calculate capital gains tax owed on stocks, cryptocurrency, and real estate sales, comparing short-term (ordinary income) vs.

What this calculator does

The Capital Gains Tax Calculator estimates your result instantly from the values you enter, using standard taxes & income formulas. Calculate capital gains tax owed on stocks, cryptocurrency, and real estate sales, comparing short-term (ordinary income) vs. Calculations run in your browser, so nothing you type is sent to a server, and the output is an estimate for planning rather than financial advice.

About Capital Gains Tax Calculator

The Capital Gains Tax Calculator computes federal and state capital gains taxes on asset sales, distinguishing between short-term gains (held ≤ 1 year, taxed as ordinary income) and preferential long-term gains (held > 1 year, taxed at 0%, 15%, or 20%), plus the 3.8% Net Investment Income Tax (NIIT).

Formula & Mathematical Calculation

Capital Gain ($) = Selling Price - Purchase Price (Cost Basis) - Transaction Fees

Long-Term Federal Tax = Capital Gain × Long-Term Bracket Rate (0%, 15%, or 20%) + NIIT (3.8% if applicable)

Calculation Example

$40,000 Profit on Stock ($60k Sale - $20k Cost Basis, Single Filer, $90k Income): Short-Term (Held 8 mos @ 22% tax) = $8,800 Tax. Long-Term (Held 18 mos @ 15% tax) = $6,000 Tax (Holding over 1 year saves $2,800 in taxes!).

Key Benefits

  • Differentiates short-term vs. preferential long-term capital gains tax rates
  • Applies IRS long-term tax brackets (0%, 15%, 20%) based on taxable income
  • Includes 3.8% Net Investment Income Tax (NIIT) for high earners
  • Supports stocks, ETFs, crypto, precious metals, and real estate
  • Essential year-end tax planning tool

How to Use this Calculator

  1. Enter Purchase Price (Cost Basis) & Sale Price
    Input original cost and final proceeds.
  2. Select Holding Period
    Choose Short-Term (≤ 1 Year) or Long-Term (> 1 Year).
  3. Select Tax Filing Status & Annual Income
    Input taxable income bracket to determine rate.
  4. Calculate Capital Gains Tax
    Click Calculate to view federal and state tax liabilities.

Assumptions & Limitations

What the calculation assumes

  • Every value you enter is treated as an exact, known amount.
  • Rates and contributions are assumed to stay constant for the whole period unless the form asks for them separately.
  • Results use standard financial formulas and ignore fees, penalties and promotional terms that are not entered above.
  • Inflation, tax changes and market volatility are not modelled unless a field for them is provided.
  • Amounts are unit-agnostic: results are returned in the same currency you enter.

What it does not cover

  • Capital Gains Tax Calculator produces estimates for education and planning, not a quote, offer or professional advice.
  • Real-world outcomes differ when fees, taxes, rounding rules or provider-specific terms apply.
  • Local regulations and tax rules vary by country and change over time; verify current rules for your jurisdiction.
  • Figures are only as accurate as the inputs you supply — check them before acting on the result.
  • For decisions with lasting financial impact, confirm the numbers with a qualified professional.

Frequently Asked Questions

Assets held for one year or less trigger short-term capital gains, taxed at ordinary income tax rates (up to 37%). Assets held for more than one year qualify for preferential long-term capital gains rates (0%, 15%, or 20%).

An additional 3.8% Net Investment Income Tax applies to net investment income (including capital gains, dividends, and royalties) for single filers with modified AGI exceeding $200,000, or married couples exceeding $250,000.

Capital losses offset capital gains dollar-for-dollar without limitation. If net losses exceed total gains, you can deduct up to $3,000 of excess losses against ordinary income annually, carrying forward unused losses indefinitely.

Homeowners who have owned and lived in their home as a primary residence for at least 2 of the past 5 years can exclude up to $250,000 of capital gain (for single filers) or $500,000 (for married filing jointly) from federal income tax.