Capital Gains Tax Calculator

Calculate capital gains tax on investment sales, with short-term vs long-term rates for 2025.

Results

Visualization

How It Works

The Capital Gains Tax Calculator determines how much federal income tax you owe when you sell an investment at a profit, accounting for whether your gain qualifies for lower long-term rates (held 1+ year) or higher short-term rates (held under 1 year). This matters because the tax difference between short-term and long-term gains can be substantial—potentially saving or costing you thousands of dollars on the same investment profit. This tool is designed for both quick estimates and detailed planning scenarios. Results update instantly as you adjust inputs, making it easy to compare different approaches and understand how each variable affects the outcome. For best accuracy, use precise measurements rather than rough estimates, and consider running multiple scenarios to establish a realistic range of expected results.

The Formula

Capital Gain = Sale Price − Purchase Price; Taxable Income = Other Taxable Income + Capital Gain; Tax Owed = (Applicable Tax Rate) × (Capital Gain or portion thereof, depending on tax bracket); Net Proceeds = Sale Price − Tax Owed

Variables

  • Purchase Price — The original amount you paid for the investment, including any commissions or fees added to the cost basis
  • Sale Price — The total amount you received when selling the investment, minus any commissions or fees paid to execute the sale
  • Holding Period — The number of months you owned the investment; determines whether the gain is taxed as short-term (under 12 months) or long-term (12 months or more)
  • Filing Status — Your tax filing category (Single, Married Filing Jointly, Married Filing Separately, or Head of Household), which determines your tax bracket thresholds
  • Other Taxable Income — Your income from wages, business, dividends, and other sources before adding the capital gain; used to determine which tax bracket applies
  • Tax Rate — For 2025, long-term rates are 0%, 15%, or 20% depending on income level and filing status; short-term gains use your ordinary income tax brackets (10%–37%)

Worked Example

Let's say you bought 100 shares of a tech stock at $25 per share (total cost: $2,500) and sold them 18 months later at $45 per share (total sale price: $4,500). Your capital gain is $2,000. You're a single filer with $55,000 in other taxable income. In 2025, for single filers, the 15% long-term capital gains rate applies to gains between roughly $47,000 and $518,000 of total income. Since your total taxable income ($55,000 + $2,000 = $57,000) falls in this range, your $2,000 gain is taxed at 15%, resulting in $300 in federal tax owed. Your net proceeds are $4,500 − $300 = $4,200. If you had instead sold after just 6 months, that same $2,000 gain would be treated as short-term income and taxed at your ordinary rate (likely 22% or 24% for this income level), costing $440–$480 in tax instead.

Practical Tips

  • Track your purchase cost basis carefully, including commissions and reinvested dividends. If you can't find original records, use brokerage statements or contact your investment firm—incorrect basis is one of the most common audit triggers for capital gains.
  • Hold investments at least 12 months (366+ days from purchase) to qualify for long-term rates. Even holding just a few days past 12 months can drop your tax rate from 24% to 15%, potentially saving thousands on large gains.
  • Consider tax-loss harvesting: if you have investment losses, use them to offset capital gains in the same year, potentially saving 15–37% on gain taxes. Unused losses can carry forward to future years.
  • Be aware of the net investment income tax (NIIT): if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married), an additional 3.8% tax applies to capital gains—don't forget to factor this into your calculation.
  • If you receive an inheritance, your cost basis 'steps up' to the value at the date of death, so you owe no tax on gains that occurred before you inherited it—only on gains after you take ownership.

Frequently Asked Questions

What's the difference between short-term and long-term capital gains?

Short-term gains (assets held 12 months or less) are taxed as ordinary income at rates from 10% to 37%, while long-term gains (held more than 12 months) get preferential rates of 0%, 15%, or 20% based on your income level and filing status. For most investors, this difference saves 10–24% in taxes on the same profit.

Do I have to pay capital gains tax if I reinvest the money?

Yes, capital gains tax is owed in the year you sell the investment, regardless of whether you reinvest the proceeds. The IRS taxes the transaction, not what you do with the money afterward. However, if you immediately buy another investment, you can still take advantage of long-term rates on the new holding period.

What if I sold at a loss? Can I use that to reduce my taxes?

Yes. Capital losses can offset capital gains in the same year, dollar-for-dollar. If losses exceed gains, you can deduct up to $3,000 of net loss against other income (like wages) in that tax year, with any remaining losses carrying forward indefinitely to future years.

How does my filing status affect the capital gains rate I pay?

Filing status determines the income thresholds for each capital gains rate bracket. For 2025, a single filer enters the 15% long-term bracket at roughly $47,000 in taxable income, while a married couple filing jointly enters at roughly $94,000. Head of Household filers have different thresholds again, so married couples often pay less tax on the same gain.

What if my cost basis is unclear or I bought the shares at different times?

For mutual funds or fractional shares bought over time, you can specify your cost basis method when selling (average cost, first-in-first-out, or specific shares). Using average cost or identifying specific high-cost shares can minimize your taxable gain. Keep detailed purchase records, and inform your broker of your chosen method in writing when you sell.

Sources

  • IRS Publication 544: Sales of Assets
  • IRS Topic 409: Capital Gains and Losses
  • 2025 Tax Brackets and Long-Term Capital Gains Rates — IRS
  • Investopedia: Capital Gains Tax
  • The Motley Fool: Long-Term vs. Short-Term Capital Gains

Last updated: April 02, 2026 · Reviewed by the CalcSuite Editorial Team · About our methodology