Skip to main content

Capital Gains Tax Calculator

Estimate the tax on your investment gains. Compares short-term vs long-term rates and includes the 3.8% Net Investment Income Tax where applicable. Uses 2026 IRS rates.

$
$
$
Salary, wages, and other ordinary income (after deductions)
Holding period
Capital gain$15,000Long-term — preferential rates
Total tax on gain$2,250
Net proceeds$12,750
Effective rate15.0%
Top bracket15%

Tax by rate

Long-term rate breakdown — Single

RateBracket rangeGain taxedTax
0%$0$48,350
15%$48,350$533,400$15,000$2,250
20%$533,400No limit
Total$15,000$2,250

Short-term vs long-term: a $15,000 gain at $75,000 income

A single filer earning $75,000 who sells stock for a $15,000 profit pays very different amounts depending on how long they held the shares. Short-term (under one year), the entire gain is taxed as ordinary income — stacked on top of salary, it falls in the 22% bracket, costing $3,300 in federal tax.

Long-term (over one year), the gain is taxed at preferential rates. With $75,000 in ordinary income already filling the 0% bracket, the entire $15,000 falls in the 15% bracket — $2,250 in tax. That's $1,050 saved by waiting twelve months. The longer holding period also avoids higher marginal rates that kick in with larger gains.

The 3.8% Net Investment Income Tax

High earners face an additional 3.8% surtax on investment income, including capital gains. It applies to the lesser of your net investment income or the amount by which your AGI exceeds $200,000 (single) or $250,000 (married filing jointly).

A single filer with $180,000 in salary and a $50,000 long-term gain has an AGI of $230,000 — exceeding the $200,000 threshold by $30,000. The NIIT applies to the lesser of the gain ($50,000) or the excess ($30,000), adding $1,140 in tax. Combined with the 15% capital gains rate, the effective rate on that gain rises from 15% to about 17.3%.

Tax-loss harvesting

Capital losses offset capital gains dollar-for-dollar. If you sell one stock for a $20,000 gain and another for a $12,000 loss in the same year, you only pay tax on $8,000 of net gains. Losses offset short-term gains first (which are taxed higher), then long-term gains.

If your losses exceed your gains, you can deduct up to $3,000 per year against ordinary income. Any unused losses carry forward indefinitely. This makes December a common time to review losing positions — selling to harvest the tax benefit, then reinvesting after the 30-day wash sale window.

This calculator does not include

This tool estimates federal capital gains tax only. It does not account for state capital gains taxes (which vary from 0% in states like Texas and Florida to 13.3% in California), depreciation recapture on real estate (taxed at 25%), collectibles (taxed at 28%), or Qualified Small Business Stock (QSBS) exclusions. Real estate sales may qualify for the Section 121 exclusion ($250,000/$500,000 for a primary residence). Consult a tax professional for your specific situation.

This calculator is for illustrative purposes only and does not constitute tax or financial advice. Tax calculations use 2026 IRS rates (Revenue Procedure 2025-32) and assume standard investment income only. Your actual tax liability may differ based on state taxes, depreciation recapture, collectibles rates, QSBS exclusions, AMT, or other adjustments. Consult a qualified tax professional for personalized guidance. MacroSpire is not a registered tax advisor.