Skip to content
TheCalcUniverse

Capital Gains Tax Calculator — Short vs. Long Term (2026 Brackets)

Calculate capital gains tax for stocks, crypto, and real estate. Enter purchase price, sale price, holding period, income, and filing status.

✓ Tested formula & cited sources Formula verified 2026-01-15 Runs in your browser — inputs never sent anywhere

The formula

Gain = Proceeds − Cost Basis | LTCG Rate = 0%/15%/20% based on income | NIIT = 3.8% on investment income above threshold

Holding Period
Holding Period
Cost Basis
Cost Basis
LTCG Rate
Long-Term Capital Gains Rate
NIIT
Net Investment Income Tax
Effective Rate
Effective Tax Rate
Full explanation ↓

How Capital Gains Tax Works

Gain = Proceeds − Cost Basis | LTCG Rate = 0%/15%/20% based on income | NIIT = 3.8% on investment income above threshold

Capital gains tax is calculated based on the holding period (short-term vs. long-term), your total taxable income, and filing status. Short-term gains are taxed at ordinary income rates, while long-term gains benefit from preferential rates of 0%, 15%, or 20%. An additional 3.8% Net Investment Income Tax (NIIT) may apply for high-income taxpayers.

Holding Period
Holding PeriodThe number of days between purchase and sale. Assets held 365 days or less are short-term; assets held longer than 365 days are long-term and qualify for lower tax rates.
Cost Basis
Cost BasisThe original purchase price of the asset, including commissions, fees, and improvements (for real estate). A higher cost basis reduces your taxable gain.
LTCG Rate
Long-Term Capital Gains RatePreferential tax rates of 0%, 15%, or 20% for assets held more than one year. The rate depends on your total taxable income and filing status. In 2026, 0% rate applies up to $47,025 for single filers.
NIIT
Net Investment Income TaxAn additional 3.8% tax on the lesser of net investment income or the excess of modified adjusted gross income over threshold amounts ($200,000 single, $250,000 married filing jointly).
Effective Rate
Effective Tax RateThe total tax paid (federal + NIIT + state) divided by the total capital gain. This represents your true blended tax rate on the investment gain.
Long-term gains (held >365 days) get preferential rates. Short-term gains are taxed as ordinary income. NIIT adds 3.8% above income thresholds.

How to Use

  1. Select the asset type (stocks, bonds, crypto, real estate, or collectibles).
  2. Enter the purchase and sale dates to calculate the holding period.
  3. Enter your cost basis (what you paid) and sale proceeds.
  4. Provide your annual ordinary income and filing status to determine the correct tax bracket.
  5. Optionally enter your state capital gains tax rate for a complete picture of your tax liability.

Quick Reference

Short-Term (≤365 days)Taxed as ordinary income (10%–37%)
Long-Term (>365 days)0%, 15%, or 20% based on total taxable income
0% LTCG Rate (Single 2025)Total income up to $47,025
15% LTCG Rate (Single 2025)Total income $47,026–$518,900
20% LTCG Rate (Single 2025)Total income $518,901+
NIIT Threshold (Single)MAGI > $200,000 (additional 3.8%)
NIIT Threshold (MFJ)MAGI > $250,000 (additional 3.8%)
Annual Capital Loss DeductionUp to $3,000 against ordinary income ($1,500 MFS)

Common Uses

  • Estimate your federal and state capital gains tax liability before selling stocks, real estate, or other appreciated investments.
  • Compare the tax impact of short-term versus long-term holding periods to decide the optimal time to sell an asset.
  • Plan tax-loss harvesting strategies by modeling how realized gains and losses offset each other in a given tax year.
  • Evaluate the after-tax return of an investment sale to make informed decisions about portfolio rebalancing.

Understanding the Result

Capital gains tax is one of the most important considerations for investors when selling assets. The tax treatment depends primarily on how long you held the asset before selling. Short-term capital gains (assets held for 365 days or less) are taxed as ordinary income at your marginal tax rate, which can be as high as 37%. This is a significant tax disadvantage compared to long-term gains, which benefit from preferential rates of 0%, 15%, or 20% depending on your income level. The difference is substantial: a high-income earner in the 37% bracket pays nearly twice the tax on short-term gains compared to long-term gains. This tax preference is a key reason why financial advisors recommend a "buy and hold" investment strategy. For 2026, the 0% long-term capital gains rate applies to single filers with total taxable income up to $47,025, married filing jointly up to $94,050, and heads of household up to $63,000. The 15% rate applies to most middle-income taxpayers, and the 20% rate applies to high-income earners. The Net Investment Income Tax (NIIT) adds an additional 3.8% for single filers with modified AGI exceeding $200,000 ($250,000 for married filing jointly). This surtax was introduced as part of the Affordable Care Act to help fund Medicare and applies to the lesser of your net investment income or the excess over the threshold. State taxes vary widely — some states like Texas, Florida, and Nevada have no state income tax, while others like California (up to 13.3%) and New York (up to 10.9%) can significantly increase the total tax burden on capital gains. Understanding these rules allows investors to make tax-aware decisions about when to sell assets and how to structure their investment portfolio.

Worked Examples

Elena in Seattle, WA sold Apple stock that she bought on January 15, 2023 for $12,500 (including commissions) and sold on March 20, 2025 for $31,000. As a single filer with $92,000 in ordinary income, she wants to know her capital gains tax liability.

assetType = Stocks · purchaseDate = 2023-01-15 · saleDate = 2025-03-20 · costBasis = 12500 · saleProceeds = 31000 · annualIncome = 92000 · filingStatus = Single · stateTaxRate = 0

Holding period: 795 days (Long-Term). Capital gain: $18,500. Total income ($92,000 + $18,500 = $110,500) falls in the 15% LTCG bracket. Federal tax: $2,775 (15%). Washington has no state income tax. Elena keeps $28,225 after federal tax.

Elena held her Apple shares for just over two years, qualifying for the preferential long-term capital gains rate. Her $18,500 gain was taxed at only 15% instead of her ordinary income marginal rate of 22% (her $92,000 income falls in the 22% single-filer bracket, up to $103,350), saving her approximately $1,295 in federal taxes compared to selling before the one-year holding period. The difference is real: short-term treatment would have cost her 22% — about $4,070 — making the long-term holding period worth the wait.

James and Maria Johnson in Portland, OR are a married couple filing jointly with $175,000 in combined ordinary income. They bought Bitcoin on November 5, 2023 for $8,000 and sold it on October 1, 2024 for $22,000. Oregon has a 9.9% state income tax.

assetType = Crypto · purchaseDate = 2023-11-05 · saleDate = 2024-10-01 · costBasis = 8000 · saleProceeds = 22000 · annualIncome = 175000 · filingStatus = Married Filing Jointly · stateTaxRate = 9.9

Holding period: 331 days (Short-Term). Capital gain: $14,000. Because the holding period is 331 days (< 365), the gain is taxed as ordinary income. Their $175,000 ordinary income places them in the 22% MFJ marginal bracket for 2026. Federal tax: $3,080 (22% of $14,000). State tax: $1,386 (9.9% of $14,000). Total tax: $4,466. After-tax proceeds: $17,534.

The Johnsons missed long-term capital gains treatment by just 34 days. Had they waited until November 6, 2024, their gain would have been taxed at the 15% LTCG rate instead of their 22% ordinary rate — saving $980 in federal taxes. This example illustrates why timing matters enormously in crypto and stock sales: holding just 34 more days would have cut their federal tax bill by nearly a third. For high-income taxpayers in states like Oregon with high state taxes, the combined short-term burden still exceeds 30% of the gain even at the 22% federal bracket.

Frequently Asked Questions

What is the difference between short-term and long-term capital gains?
Short-term capital gains are profits from assets held for 365 days or less and are taxed at your ordinary income tax rate (up to 37%). Long-term capital gains are from assets held more than 365 days and are taxed at preferential rates of 0%, 15%, or 20%. This difference can result in paying nearly half the tax on long-term gains compared to short-term gains for high-income earners.
What is the Net Investment Income Tax (NIIT) and who pays it?
The NIIT is an additional 3.8% surtax on net investment income that applies to individuals with modified adjusted gross income exceeding $200,000 ($250,000 for married filing jointly). It was introduced by the Affordable Care Act and applies to interest, dividends, capital gains, rental income, and other passive investment income. The tax is 3.8% of the lesser of your net investment income or the excess over the threshold.
Can I offset capital gains with capital losses?
Yes, capital losses can offset capital gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) of net capital losses against ordinary income each year. Remaining losses carry forward to future tax years indefinitely. This strategy, known as tax-loss harvesting, is commonly used to reduce taxable gains.
How do state taxes affect my capital gains tax bill?
State capital gains tax rates vary widely. Some states (Texas, Florida, Nevada, South Dakota, Tennessee, Wyoming, Alaska, New Hampshire) have no state income tax. Others tax capital gains as ordinary income, with top rates from about 4% to 13.3%. A few states have special rates for capital gains. Enter your state's rate to see the combined federal-state tax impact.
How accurate is this calculator for real-world use?
This calculator uses standard mathematical formulas and provides estimates based on the inputs you enter. For financial decisions, always verify results with a qualified professional and check against official statements or lender-provided figures which may include additional factors not modeled here.

Pro Tips

  • The holding period clock starts the day AFTER purchase. If you bought on January 15, the one-year mark is January 16 of the following year — sell on January 15 and you have held for exactly 365 days (short-term). Wait one more day for long-term treatment.
  • Tax-loss harvesting: sell losing positions before year-end to offset gains. Up to $3,000 of net losses can offset ordinary income, with the remainder carried forward indefinitely. This is one of the few free lunches in tax planning.
  • If you are in the 0% LTCG bracket (single filers with total income under $47,025 in 2025), consider realizing gains up to the top of the 0% bracket each year — it is essentially a tax-free step-up in cost basis that reduces future tax liability.
  • The 3.8% Net Investment Income Tax applies to single filers above $200,000 and married couples above $250,000. If you are near the threshold, timing income across tax years — or maximizing pre-tax retirement contributions to reduce MAGI — can avoid the surtax on capital gains.

Limitations to Know

  • The holding period calculation counts calendar days and starts the day after purchase. The calculator treats 365 days as short-term per IRS rules (must exceed 365 days for long-term). However, weekends, holidays, and market closures are not considered — the actual trade settlement date may differ from your entered dates.
  • The short-term tax rate uses a simplified marginal bracket lookup based on annual ordinary income alone. Real tax calculations consider deductions, credits, phase-outs, and the stacking of capital gains on top of ordinary income. The actual marginal rate may differ by one bracket.
  • State tax treatment is simplified to a flat rate. Many states have graduated brackets, special capital gains exclusions (like the home sale exclusion), or exemption thresholds. Consult your state's tax authority for precise rates.
  • This calculator does not handle wash sales (selling and repurchasing the same security within 30 days), which disallow loss deductions under IRS rules. It also does not model the qualified small business stock exclusion (Section 1202) or opportunity zone deferrals.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "Capital Gains Tax Calculator — Short vs. Long Term (2026 Brackets)." TheCalcUniverse, 2026, https://thecalcuniverse.com/finance/capital-gains-tax-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator