3tej home
 US Tax

Capital Gains Calculator

US capital gains tax depends on holding period (STCG vs LTCG), filing status, total income, and asset type. Calculate the tax owed on your investment gains.

Quick answer. US capital gains tax depends on holding period (STCG vs LTCG), filing status, total income, and asset type. Calculate the tax owed on your investment gains.
Use the working calculator

US Capital Gains Calculator

Working calculator with full bracket walking for any income level.

Open US Capital Gains Calculator →

About this tool

A capital gains calculator computes the federal (and optionally state) tax owed on the profit from selling an investment, given the asset's holding period, your filing status, and your other ordinary income for the year. The US tax code splits capital gains into two rate schedules: short-term (held one year or less) taxed at ordinary-income rates from 10 to 37 percent, and long-term (held more than one year) taxed at preferential 0, 15, or 20 percent rates based on taxable income brackets.

The calculator also flags four special cases that change the rate: collectibles (art, coins, precious metals) capped at 28 percent, Section 1250 unrecaptured depreciation on real estate capped at 25 percent, the 3.8 percent Net Investment Income Tax (NIIT) on high-income filers, and Qualified Small Business Stock (QSBS) Section 1202 which excludes up to $10 million of gain entirely.

How it works

Holding period          = Sale date - Purchase date - 1 day
STCG tax                = Gain x marginal ordinary-income rate (10 to 37%)
LTCG tax                = Gain stacked on top of ordinary income, walked through 0/15/20 brackets
NIIT (if MAGI > $200K) = 3.8% x lesser of (net investment income, MAGI - threshold)
Total tax               = STCG tax + LTCG tax + NIIT + state tax
  • Holding period = 365 days plus 1 to qualify as long-term. Day-of-purchase does NOT count, day-of-sale DOES count.
  • Gain = sale price - adjusted cost basis (purchase price + commissions + capital improvements - depreciation).
  • LTCG brackets 2026 single: 0 percent up to $48,350, 15 percent to $533,400, 20 percent above.
  • LTCG brackets 2026 MFJ: 0 percent up to $96,700, 15 percent to $600,050, 20 percent above.
  • NIIT threshold 2026: $200,000 single, $250,000 MFJ; not indexed for inflation.

Worked example

Consider a single filer in 2026 with $200,000 of W-2 wages who sold stock held for 18 months at a $50,000 long-term capital gain:

  1. Holding period: 18 months > 12 months, so long-term capital gain.
  2. Stacking: $200,000 ordinary income places the entire $50,000 gain in the 15 percent LTCG bracket (since LTCG 15 percent runs from $48,350 to $533,400 for single).
  3. LTCG federal tax: $50,000 x 0.15 = $7,500.
  4. NIIT check: MAGI = $200,000 + $50,000 = $250,000, threshold = $200,000, so MAGI - threshold = $50,000. NIIT = 3.8 percent x $50,000 (the gain, since that is the lesser of net investment income or excess MAGI) = $1,900.
  5. Total federal tax on gain: $7,500 + $1,900 = $9,400.
  6. Effective federal rate on gain: $9,400 / $50,000 = 18.8 percent.
  7. State tax (California example): add 9.3 percent x $50,000 = $4,650, so total tax = $14,050 and effective rate = 28.1 percent.
  8. Contrast STCG scenario: if held 11 months, $50,000 sits in 32 percent ordinary bracket = $16,000 federal + $1,900 NIIT = $17,900, effective 35.8 percent.
Result: Holding the asset 18 months instead of 11 months cuts federal tax from $17,900 to $9,400, a saving of $8,500 on a $50,000 gain. The full California-resident bill including state tax is $14,050 long-term vs $22,550 short-term, $8,500 saved by holding past the one-year mark.

2026 long-term capital gains brackets

RateSingleMarried Filing JointlyHead of Household
0%Up to $48,350Up to $96,700Up to $64,750
15%$48,350 to $533,400$96,700 to $600,050$64,750 to $566,700
20%Above $533,400Above $600,050Above $566,700
+NIIT 3.8%Above $200,000 MAGIAbove $250,000 MAGIAbove $200,000 MAGI
Top combined federal23.8% (20% + NIIT)23.8%23.8%
Collectibles cap28%28%28%
Sec 1250 real estate depr recap25%25%25%

Common mistakes

  • Missing the one-year hold by a day. The clock starts the day after purchase. Selling on the one-year anniversary date counts as short-term. Add at least one extra day for safety.
  • Forgetting NIIT. The 3.8 percent surtax applies to the lesser of net investment income or MAGI over the threshold. At $200K single MAGI, every dollar of investment income is hit.
  • Ignoring state tax. California's 13.3 percent top state rate stacks on top of federal 23.8 percent for a combined 37.1 percent on top-bracket LTCG, more than the federal STCG rate of 37 percent.
  • Mishandling specific lot identification. Default is FIFO, but using Specific Identification (or HIFO at brokers that support it) can dramatically lower realized gains. Choose lots BEFORE the sale settles, not on the 1099 in February.
  • Triggering the wash sale rule. Buying the same security 30 days before or after a loss sale disallows the loss. Includes IRA purchases and 401(k) replicating funds, which are commonly missed.
  • Not harvesting gains in the 0 percent bracket. Single filers with taxable income under $48,350 can realize LTCG at zero tax federal. Many retirees and early-FIRE households leave this on the table by not actively realizing during low-income years.

Related tools and concepts

Frequently asked questions

What is the 2026 zero percent capital gains bracket?

In 2026, single filers with taxable income up to 48,350 USD pay 0 percent on long-term capital gains and qualified dividends. MFJ up to 96,700 USD. Head of Household up to 64,750 USD. Many retirees and early-FIRE households use this to harvest tax-free gains by realizing LTCG up to the bracket cap each year, then immediately repurchasing to step up cost basis at zero tax cost (not a wash sale because gains are not losses).

Does my state tax capital gains?

Most states tax capital gains the same as ordinary income at the state rate. Notable exceptions: California taxes LTCG at the full state income tax rate (top 13.3 percent, the highest in the nation), Washington added a 7 percent state LTCG tax above 270,000 USD threshold in 2022, and the nine no-income-tax states (FL, TX, NV, WA on most income, TN, AK, WY, SD, NH) impose no state capital gains tax. New Hampshire previously taxed investment income but phased that out by 2025.

What is the wash sale rule?

If you sell at a loss and buy the same or substantially identical security within 30 days before or after the sale date (the 61-day window), the loss is DISALLOWED for tax purposes. The disallowed loss is added to the basis of the replacement shares, deferring rather than eliminating the deduction. Applies to stocks, ETFs, mutual funds, and bonds. Does NOT currently apply to cryptocurrency, which is why crypto investors can tax-loss harvest more aggressively, though this loophole is regularly proposed for legislative closure.

How does the Net Investment Income Tax work?

NIIT is an additional 3.8 percent surtax on investment income (capital gains, dividends, interest, rental income) for taxpayers with modified AGI above 200,000 USD single, 250,000 USD MFJ, 125,000 USD MFS. The tax is the lesser of (a) all net investment income or (b) MAGI above the threshold. It stacks on top of the 15 or 20 percent LTCG rate, making the effective top federal LTCG rate 23.8 percent. NIIT thresholds have not been indexed for inflation since 2013, so the surtax catches more filers each year.

Sources

  • IRS (2026) Revenue Procedure 2025-32, inflation-adjusted tax brackets for 2026.
  • IRS Topic 409 (2025) Capital Gains and Losses.
  • IRS Publication 550 (2025) Investment Income and Expenses - basis, holding period, wash sale rules.
  • IRC Section 1411 - Net Investment Income Tax.
  • Tax Foundation (2025) State Individual Income Tax Rates and Brackets.

Last updated 2026-05-28.