Skip to content
Tax

Capital Gains Calculator

Calculate short-term and long-term capital gains tax, net profit after taxes, and effective tax rates on stocks, real estate, and investment assets.

Asset & Transaction Details

$
Quick purchase presets:
$
$
Quick selling presets:
$
$
%

Total Capital Gain

$28,500.00

Pre-tax gain of 139.0% on $20,500.00 basis

Total Estimated Tax

$5,700.00

Effective tax rate: 20.0%

Net Profit After Tax

$22,800.00

After-tax ROI: 111.2%

Federal Tax Bracket

15% (Marginal)

Long-Term (> 1 year)

Federal Capital Gains Tax

$4,275.00

Preferential LTCG rate

Net Investment Surtax (NIIT)

$0.00

Below NIIT income threshold

State Tax

$1,425.00

5.0% state rate

Gross proceeds distribution

Net Proceeds$49,000.00
  • Adjusted Cost Basis$20,500.0041.8%
  • Net After-Tax Profit$22,800.0046.5%
  • Federal Capital Gains Tax$4,275.008.7%
  • State & NIIT Taxes$1,425.002.9%

How your capital gains tax is calculated

Four clear steps detailing cost basis adjustment, bracket stacking, surtaxes, and net after-tax yield.

  1. Calculate Adjusted Cost Basis and Net Proceeds

    Adjusted Basis=$20,000+$500=$20,500Net Proceeds=$50,000$1,000=$49,000\begin{aligned} \text{Adjusted Basis} &= \$20,000 + \$500 = \$20,500 \\ \text{Net Proceeds} &= \$50,000 - \$1,000 = \$49,000 \end{aligned}

    Add purchase costs and subtract selling fees to establish your true tax basis.

  2. Determine Capital Gain or Loss

    Capital Gain=Net ProceedsAdjusted Basis=$49,000$20,500=$28,500\text{Capital Gain} = \text{Net Proceeds} - \text{Adjusted Basis} = \$49,000 - \$20,500 = \$28,500

    Subtract adjusted basis from net proceeds to determine taxable gain.

  3. Compute Federal and Surtax Liability

    Federal Tax=$4,275(NIIT 3.8%=$0)\text{Federal Tax} = \$4,275 \quad (\text{NIIT 3.8\%} = \$0)

    Long-term rates (0%, 15%, or 20%) apply based on your taxable income base of $75,000.00.

  4. Apply State Tax and Calculate Net After-Tax Return

    Net Profit After Tax=$28,500$5,700=$22,800\text{Net Profit After Tax} = \$28,500 - \$5,700 = \$22,800

    Deduct total taxes from your capital gain to find net return and after-tax ROI.

Tax brackets, standard deduction thresholds, and Net Investment Income Tax (NIIT) limits reflect the 2025 tax year. Real estate depreciation recapture, section 1202 exclusions, or wash sales may alter your actual tax liability.
Report tool

Mastering Capital Gains Tax: Formulas, Brackets, and Net After-Tax Returns

A capital gain occurs whenever you sell a capital asset, such as individual stocks, mutual funds, exchange-traded funds, cryptocurrencies, real estate, or precious metals, for more than your adjusted purchase price. Understanding how federal, state, and surtax rates apply to your gains is vital for maximizing your net investment returns and making informed portfolio decisions.

Under United States tax regulations for the 2025 tax year, the tax treatment of capital gains depends primarily on two criteria: the duration of your holding period and your overall taxable income level.

The Capital Gain and Adjusted Basis Formulas

Calculating your taxable capital gain requires first establishing your adjusted cost basis and net sale proceeds:

Adjusted Cost Basis=Purchase Price+Acquisition Fees+Capital ImprovementsNet Sale Proceeds=Gross Selling PriceSelling Commissions and Transfer FeesCapital Gain (or Loss)=Net Sale ProceedsAdjusted Cost Basis\begin{aligned} \text{Adjusted Cost Basis} &= \text{Purchase Price} + \text{Acquisition Fees} + \text{Capital Improvements} \\ \text{Net Sale Proceeds} &= \text{Gross Selling Price} - \text{Selling Commissions and Transfer Fees} \\ \text{Capital Gain (or Loss)} &= \text{Net Sale Proceeds} - \text{Adjusted Cost Basis} \end{aligned}

If the resulting value is positive, you have realized a capital gain. If the value is negative, you have realized a capital loss, which can be used to offset other taxable capital gains.

Short-Term vs. Long-Term Capital Gains

The holding period is defined by the exact calendar timeframe between the acquisition date and the settlement sale date:

  • Short-Term Capital Gains (Held 1 Year or Less): Taxed as ordinary income according to standard federal tax brackets (10%, 12%, 22%, 24%, 32%, 35%, and 37%).
  • Long-Term Capital Gains (Held More Than 1 Year): Eligible for preferential statutory tax rates (0%, 15%, or 20%), providing significant tax savings compared to short-term trading.

2025 Long-Term Capital Gains Tax Brackets

Federal long-term capital gains tax brackets for the 2025 tax year are structured as follows:

Filing Status0% Bracket15% Bracket20% Bracket
Single$0 to $48,350$48,351 to $533,400Over $533,400
Married Filing Jointly$0 to $96,700$96,701 to $600,050Over $600,050
Married Filing Separately$0 to $48,350$48,351 to $300,025Over $300,025
Head of Household$0 to $64,750$64,751 to $566,700Over $566,700

Net Investment Income Tax (NIIT 3.8%)

High-income investors may also be subject to the 3.8% Net Investment Income Tax (NIIT). This surtax applies to the lesser of your total net investment income or the amount by which your modified adjusted gross income exceeds statutory statutory thresholds:

  • Single / Head of Household: $200,000
  • Married Filing Jointly: $250,000
  • Married Filing Separately: $125,000

Step-by-Step Worked Calculation Example

Suppose a Single filer bought shares for $20,000 with $500 in purchase fees, and later sold them for $50,000 after holding them for two years, paying $1,000 in selling broker commissions. The investor also earns $75,000 in other taxable income and faces a 5% state tax rate.

  1. Step 1: Calculate Basis and Net Proceeds
    Adjusted Basis=$20,000+$500=$20,500Net Proceeds=$50,000$1,000=$49,000\begin{aligned} \text{Adjusted Basis} &= \$20,000 + \$500 = \$20,500 \\ \text{Net Proceeds} &= \$50,000 - \$1,000 = \$49,000 \end{aligned}
  2. Step 2: Calculate Capital Gain
    Capital Gain=$49,000$20,500=$28,500\text{Capital Gain} = \$49,000 - \$20,500 = \$28,500
  3. Step 3: Determine Federal Long-Term Tax

    With base taxable income of $75,000, the 0% threshold ($48,350) is already fully utilized. The entire $28,500 gain falls within the 15% bracket ($48,350 to $533,400).

    Federal Tax=$28,500×0.15=$4,275\text{Federal Tax} = \$28,500 \times 0.15 = \$4,275
  4. Step 4: Calculate State Tax and Net Profit
    State Tax=$28,500×0.05=$1,425Total Tax=$4,275+$1,425=$5,700Net Profit After Tax=$28,500$5,700=$22,800\begin{aligned} \text{State Tax} &= \$28,500 \times 0.05 = \$1,425 \\ \text{Total Tax} &= \$4,275 + \$1,425 = \$5,700 \\ \text{Net Profit After Tax} &= \$28,500 - \$5,700 = \$22,800 \end{aligned}

The investor achieves a pre-tax return on investment of 139.02%, an effective tax rate on gain of 20.0%, and a net after-tax return on investment of 111.22%.

Strategies to Minimize Capital Gains Taxes

Proactive tax planning can significantly reduce your tax exposure when liquidating profitable investments:

  • Cross the 1-Year Threshold: Whenever feasible, hold appreciated assets for at least 366 days to qualify for preferential long-term rates rather than higher ordinary tax brackets.
  • Tax-Loss Harvesting: Realize capital losses in losing positions before year-end to offset realized taxable gains dollar-for-dollar. If losses exceed gains, you can deduct up to $3,000 of net loss against ordinary income annually.
  • Utilize Tax-Advantaged Accounts: Hold high-turnover trading strategies in retirement accounts such as a 401(k) or IRA where gains grow tax-deferred or tax-free. Model retirement growth using our 401(k) calculator.
  • Section 121 Primary Residence Exclusion: If selling your primary home and meeting ownership and use tests (2 of the last 5 years), exclude up to $250,000 of capital gain (or $500,000 for married couples filing jointly).
  • Section 1031 Like-Kind Exchanges: Real estate investors can defer capital gains taxes when selling investment real estate by reinvesting all proceeds into qualifying replacement property within statutory deadlines.

For independent contractors evaluating general self-employment liabilities alongside investment income, consult the 1099 tax calculator. When comparing lifetime sales against holding appreciated assets until death for a stepped-up basis, estimate potential transfer taxes with the estate tax calculator. To calculate total deductions and baseline adjusted income, use the AGI calculator. To isolate pure price appreciation from dividend yield and cash distributions, use our capital gains yield calculator. To evaluate annualized compound portfolio returns across multi-year holding periods, visit the CAGR calculator, or analyze leverage and margin accounts with the buying power calculator.

Frequently asked questions

What is the capital gains tax rate for the 2025 tax year?
For 2025, long-term capital gains tax rates are 0%, 15%, or 20% depending on your taxable income and filing status. Short-term capital gains are taxed as ordinary income at rates ranging from 10% to 37%. High earners may also owe a 3.8% Net Investment Income Tax (NIIT).
How does capital loss deduction work if I sell at a loss?
Capital losses first offset capital gains of the same type (short-term against short-term, long-term against long-term), then against other gains. If net losses exceed total gains, up to $3,000 ($1,500 if married filing separately) can offset ordinary income per year, with unused losses carrying forward indefinitely to future tax years.
What is the wash-sale rule and how does it affect cost basis?
Under IRS rules, if you sell a security at a loss and purchase a substantially identical security within 30 days before or after the sale, the loss is disallowed for immediate tax deduction. Instead, the disallowed loss is added to the cost basis of the newly purchased shares, postponing the tax benefit until the new position is sold.
Do states tax capital gains differently than the federal government?
Yes. Most states tax capital gains as regular state taxable income without preferential long-term discounts, with top rates ranging from 0% in states like Florida, Texas, and Washington (except for high-value excise on financial assets) to over 9% in states like California and New York.
How do purchase fees and improvements adjust my cost basis?
Acquisition commissions, legal expenses, transfer fees, and qualifying capital improvements (for real estate) increase your adjusted cost basis. A higher cost basis reduces your taxable capital gain when you eventually sell the asset.
Are my calculations saved or sent to any server?
No. All calculations run completely client-side in your web browser. No transaction details, income figures, or asset values are transmitted or stored on any server.

Resources and references

The formulas and methods in this calculator were checked against these independent sources.