Capital Gains Tax

Estimate tax on profits.

2025 Capital Gains Tax Calculator Overview

The capital gains tax calculator computes the federal tax you owe when you sell a capital asset — stocks, bonds, mutual funds, real estate, business interests, collectibles — at a profit. The tax rate depends on two factors: how long you held the asset and your total taxable income. Getting this calculation right before you sell can save thousands of dollars through strategic timing and loss harvesting.

The IRS distinguishes between two types of capital gains:

  • Short-term capital gains (STCG): Profits on assets held for one year or less. Taxed as ordinary income — the same rate as wages, up to 37% in 2025. There is no preferential rate for short-term gains.
  • Long-term capital gains (LTCG): Profits on assets held for more than one year. Taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income, per the IRS capital gains tax topic. Most middle-income investors pay the 15% rate; the 0% rate applies to those in lower income brackets.

2025 Long-Term Capital Gains Tax Brackets:

  • 0%: Single filers with taxable income up to $48,350; Married filing jointly up to $96,700; Head of household up to $64,750
  • 15%: Single $48,350–$533,400; MFJ $96,700–$600,050; HoH $64,750–$566,700
  • 20%: Single above $533,400; MFJ above $600,050; HoH above $566,700

Additionally, high-income taxpayers owe the 3.8% Net Investment Income Tax (NIIT) on the lesser of net investment income or the amount by which MAGI exceeds $200,000 (single) or $250,000 (MFJ), per IRS NIIT guidance. This means the effective maximum LTCG rate is 23.8% (20% + 3.8%) for the highest earners — still dramatically lower than the 37% ordinary income rate on short-term gains.

For Canadian investors, capital gains are subject to the Canada Revenue Agency inclusion rate rules — currently 50% for individuals (up to $250,000 of annual capital gains) and 67% above that threshold (following the 2024 federal budget change), included in ordinary income and taxed at your marginal provincial + federal rate. See CRA capital gains guidance.

Capital Gains Tax Formula and Calculation Method

Capital gains tax is calculated in four steps: determine the holding period, compute the gain, apply the applicable rate (which may be split across brackets), and add the NIIT if applicable.

Step 1 — Capital Gain
Capital Gain = Sale Price − Adjusted Cost Basis
Adjusted Cost Basis = Purchase Price + Commissions + Improvements − Depreciation

Step 2 — Holding Period Classification
Short-term: Held ≤ 365 days → taxed at ordinary income rates (10%–37%)
Long-term: Held > 365 days → taxed at 0%, 15%, or 20% (2025 brackets)

Step 3 — 2025 LTCG Rate Application (Single Filer)
0% on gain that falls within taxable income ≤ $48,350
15% on gain within taxable income $48,350–$533,400
20% on gain above $533,400

Step 4 — Add NIIT if MAGI > $200,000 (single) or $250,000 (MFJ)
NIIT = 3.8% × min(net investment income, MAGI − threshold)

Total Tax = Ordinary Income Tax + LTCG Tax + NIIT

Worked Example — Single Filer, $95,000 Ordinary Income, $50,000 Long-Term Gain:

  • Taxable income before gain: $95,000 − $15,000 standard deduction = $80,000
  • Total taxable income with gain: $80,000 + $50,000 = $130,000
  • LTCG stacks on top of ordinary income: the $80,000 of ordinary income fills brackets up to $80,000; the $50,000 LTCG sits between $80,000 and $130,000
  • 0% LTCG bracket: $48,350 threshold. The ordinary income of $80,000 already exceeds this, so none of the $50,000 gain qualifies for the 0% rate.
  • 15% LTCG bracket: all $50,000 of gain falls between $80,000 and $533,400 → 15% × $50,000 = $7,500
  • NIIT: MAGI = $130,000 < $200,000 threshold → $0 NIIT
  • Total LTCG tax: $7,500

Compare to short-term treatment: $50,000 STCG added to $80,000 ordinary income would push total taxable income to $130,000. The portion from $103,350 to $130,000 ($26,650) is taxed at 22%, and the portion from $80,000 to $103,350 ($23,350) is also at 22%. Short-term tax ≈ $50,000 × 22% = $11,000. The long-term rate saves $3,500 — on a $50,000 gain, holding one extra day past the one-year mark could be worth thousands in reduced taxes.

How to Calculate Your Capital Gains Tax

Use these steps to accurately calculate your capital gains tax before selling an asset.

  1. Determine your cost basis. The cost basis is what you paid for the asset, adjusted for certain events. For stocks, it is the purchase price plus commissions. For inherited assets, the basis is "stepped up" to the fair market value on the date of the decedent's death — a major tax advantage. For gifted assets, it is typically the donor's original basis (carryover basis). For real estate, the original purchase price is adjusted for improvements and depreciation. Your brokerage firm is required to track and report cost basis on Form 1099-B for covered securities (generally those purchased after 2011).
  2. Compute the gross gain or loss. Gain = Proceeds − Adjusted Basis. If you sold 100 shares at $85 each that you purchased at $42, the gain is (100 × $85) − (100 × $42) = $8,500 − $4,200 = $4,300. If you received dividends that were automatically reinvested, each reinvestment lot has its own purchase price and holding period.
  3. Determine the holding period. Count from the day after purchase to and including the date of sale. The IRS uses a strict day-counting rule: if you bought on March 15, 2024 and sold on March 15, 2025 — exactly 365 days — the gain is SHORT-term. You must hold until March 16, 2025 for long-term treatment. Brokerage platforms typically display the holding period alongside each position.
  4. Net gains against losses (tax-loss harvesting). Short-term losses offset short-term gains first, then long-term gains. Long-term losses offset long-term gains first, then short-term gains. Net losses up to $3,000/year can offset ordinary income (wages, etc.); excess losses carry forward to future years. Example: $15,000 LTCG and $10,000 in realized LTCL → net LTCG of $5,000 is taxable.
  5. Estimate your taxable income for the year. Enter your expected W-2 wages, business income, other investment income, and deductions. The calculator needs your ordinary income to determine where the capital gain "stacks" in the tax bracket structure — since LTCG sits on top of ordinary income for rate purposes.
  6. Enter the gain into the calculator. Specify whether it is short-term or long-term, your filing status, and your total ordinary taxable income. The calculator applies the 2025 brackets, checks for NIIT applicability, and outputs your capital gains tax liability, effective rate, and after-tax proceeds.
  7. Review state capital gains tax. Most states do not distinguish between short- and long-term gains — both are taxed at your state ordinary income rate. California (13.3% top rate), New York (10.9%), and Oregon (9.9%) represent the highest state capital gains tax burdens. Nine states have no income tax (Florida, Texas, Nevada, etc.). Factor in your state rate for a complete picture. Canadian residents apply provincial rates per their home province.

Understanding Your Capital Gains Tax Results

Your capital gains tax calculation reveals several important metrics that should guide your selling decisions.

After-Tax Proceeds: The net amount you keep after federal and state capital gains tax. On a $100,000 gain for a California single filer in the 15% LTCG bracket, federal LTCG tax is $15,000 and California state tax is ~$13,300 — leaving after-tax proceeds of $71,700. This is the actual wealth created by the sale. For a short-term gain at the same income level, federal tax would be ~$22,000 (22% bracket), making the long-term after-tax proceeds $18,600 more simply by waiting past the one-year mark.

Marginal vs. Effective LTCG Rate: If your gain spans multiple brackets (e.g., part at 0% and part at 15%), your marginal rate is 15% but your effective rate on the total gain is lower. The calculator shows both. A single filer with $30,000 in ordinary taxable income and a $40,000 LTCG: the first $18,350 of gain fills the 0% bracket ($48,350 − $30,000), and the remaining $21,650 is taxed at 15%. Effective LTCG rate = $3,247.50 ÷ $40,000 = 8.1%.

The 0% Bracket Opportunity: Single filers with taxable income below $48,350 and married filers below $96,700 pay zero federal tax on long-term capital gains. This creates a powerful planning opportunity: in years with low income (early retirement before Social Security, business loss years, years of high deductions), deliberately harvesting long-term gains at 0% resets your cost basis to the current higher price, permanently reducing future taxable gains. This strategy — "gain harvesting" — is the inverse of tax-loss harvesting.

Collectibles and Unrecaptured Section 1250 Gain: Special rates apply to certain asset types. Gains from collectibles (coins, art, antiques) are taxed at a maximum of 28% even for long-term holdings. Unrecaptured Section 1250 gain (depreciation recapture on real property) is taxed at a maximum of 25% — not the preferential 0/15/20% rates. The calculator flags these special categories based on asset type input.

Wash-Sale Rule Impact: If you sell a security at a loss and repurchase the same or substantially identical security within 30 days before or after the sale, the IRS wash-sale rule disallows the loss. The disallowed loss is added to the cost basis of the repurchased shares — it is deferred, not permanently lost. Violating the wash-sale rule while pursuing tax-loss harvesting is a common and costly mistake.

Expert Capital Gains Tax Minimization Strategies

  • Wait past one year to convert STCG to LTCG — the tax savings can be enormous. For a high-income single earner in the 37% ordinary income bracket, converting a $50,000 short-term gain to long-term saves ($50,000 × (37% − 20%)) = $8,500 in federal tax by waiting one additional day past the one-year mark. Before selling a position you've held for 11 months, always check the holding-period date. Brokerage platforms display this clearly for each lot.
  • Harvest losses annually to offset gains. Review your taxable portfolio every November and December for unrealized losses that can be realized to offset current-year gains. A $20,000 loss harvested against a $20,000 LTCG saves $3,000 (at 15%) to $5,600 (at 23.8% with NIIT) in federal tax. Immediately reinvest in a similar (but not substantially identical) fund to maintain market exposure. For example, sell a Vanguard S&P 500 ETF at a loss and immediately buy a Schwab S&P 500 ETF — similar exposure, no wash-sale violation.
  • Use the 0% LTCG bracket strategically in low-income years. If your income drops below $48,350 (single) or $96,700 (MFJ) in any year — due to early retirement, sabbatical, or high deductions — sell appreciated assets with no federal capital gains tax. A retiree in their early 60s before Social Security claiming might have $40,000 in income and a $48,350 LTCG threshold, allowing them to harvest $8,350 in gains completely tax-free. Repeat this annually over multiple low-income years to systematically reset cost basis.
  • Donate appreciated securities directly to charity. If you intend to make charitable contributions, donate appreciated long-term securities directly rather than selling first and donating cash. You avoid the capital gains tax entirely and still get a full fair-market-value charitable deduction. On a stock with a $0 basis worth $10,000, you avoid $1,500 in LTCG tax (at 15%) and deduct $10,000 — a dual tax benefit worth $1,500 in saved LTCG tax plus $2,200+ in income tax deduction (at 22% marginal rate).
  • Consider a charitable remainder trust for large appreciated positions. A CRT allows you to contribute a large appreciated asset, avoid immediate capital gains tax at transfer, take a partial charitable deduction, and receive an income stream for life or a term of years. The remaining assets go to charity at death. For someone with $1,000,000 of low-basis stock, a CRT can defer $150,000–$200,000 in capital gains tax while generating lifetime income and a charitable deduction of $200,000–$400,000 depending on the trust structure.
  • Leverage Opportunity Zone (QOZ) investments to defer and reduce LTCG. Gains reinvested in a qualified opportunity zone fund within 180 days of realization defer federal tax until 2026 (or earlier sale). Additionally, gains held in the QOZ fund for 10+ years are permanently excluded from federal tax. A $200,000 capital gain reinvested in a QOZ fund in 2025 defers the $30,000 LTCG tax due until 2026, and any new gains on the QOZ investment itself over 10 years are permanently tax-free per IRS Opportunity Zone guidance.

Frequently Asked Questions About Capital Gains Tax

What are the 2025 long-term capital gains tax rates?

In 2025, long-term capital gains (assets held more than one year) are taxed at three federal rates. The 0% rate applies to single filers with taxable income up to $48,350 and married filing jointly up to $96,700. The 15% rate applies to single filers with income between $48,350 and $533,400 (MFJ: $96,700–$600,050). The 20% rate applies above those thresholds. High-income filers also owe an additional 3.8% Net Investment Income Tax, bringing the effective maximum federal rate to 23.8%. See IRS Topic 409 for authoritative detail.

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

Short-term capital gains are profits on assets held for one year or less and are taxed as ordinary income — the same rates as wages (10%–37% in 2025). Long-term capital gains are profits on assets held for more than one year and are taxed at preferential 0%, 15%, or 20% federal rates. The holding period determination is strict: an asset must be held for more than 365 days — not equal to 365 days — to qualify for long-term treatment.

Do capital gains affect my ordinary income tax bracket?

Capital gains themselves are not taxed at ordinary income rates (for long-term), but they do increase your adjusted gross income and can push your ordinary income into higher brackets. They also affect IRMAA Medicare surcharges, the taxability of Social Security benefits, eligibility for certain deductions, and the NIIT threshold. It is important to model capital gains in the context of your total income picture, not in isolation.

What is the capital gains tax rate on home sales?

Home sale gains qualify for a major exclusion under IRS Section 121: single filers can exclude up to $250,000 of gain; married filing jointly can exclude up to $500,000, provided the home was your primary residence for at least 2 of the last 5 years. Gains above the exclusion are taxed as long-term capital gains if the home was held for more than one year. A couple selling a home for $1,200,000 with a $400,000 basis and a $500,000 exclusion owes LTCG tax on ($800,000 gain − $500,000 exclusion) = $300,000, taxed at their applicable LTCG rate. Depreciation previously deducted (for home office or rental use) is subject to 25% unrecaptured Section 1250 recapture tax, not the standard LTCG rates.

How do I report capital gains on my tax return?

Capital gains are reported on Schedule D (Form 1040) and the details of each transaction on Form 8949. Your brokerage provides a consolidated Form 1099-B in February with all proceeds, cost basis (for covered securities), and holding period information. Short-term gains go to Part I of Schedule D; long-term gains to Part II. The net gain flows to Form 1040 line 7. If you have NIIT liability, report it on Form 8960.