Capital Gains Tax Calculator 2025 | Short-Term & Long-Term (NIIT + State)
Calculate your capital gains taxes on short- and long-term gains, including NIIT and state taxes. See after-tax proceeds, detailed breakdowns, and strategies to reduce investment taxes.
Last updated: January 7, 2026
Understanding Capital Gains Taxes
Capital gains are profits from selling investments such as stocks, ETFs, crypto, bonds, or real estate (excluding your primary home). The IRS categorizes gains by holding period, which dramatically affects your tax rate:
Tax Rates by Holding Period:
- • Short-term (≤ 1 year): Taxed as ordinary income at your marginal rate (10% to 37%)
- • Long-term (> 1 year): Preferential rates of 0%, 15%, or 20% based on taxable income
- • 0% bracket: Single up to ~$47,000, Married up to ~$94,000 (thresholds adjust annually—verify at irs.gov)
- • 15% bracket: Single $47,000-$518,000, Married $94,000-$583,000
- • 20% bracket: Income exceeding thresholds above
Additional considerations: State taxes vary widely (0% in Texas/Florida vs 13.3% in California). NIIT (Net Investment Income Tax) adds 3.8% when Modified Adjusted Gross Income exceeds $200,000 (single) or $250,000 (married). Capital losses offset gains; up to $3,000 can offset ordinary income annually, with unlimited carryforwards to future years.
How to Use the Capital Gains Tax Calculator
Step 1: Select your tax year (2024 or 2025), filing status(single, married filing jointly, etc.), and state. State selection affects both income tax rates and whether capital gains receive special treatment.
Step 2: Enter short-term gains and losses (assets held ≤ 1 year) separately. Include stocks, crypto, and other investments sold within a year of purchase. The calculator nets these automatically.
Step 3: Enter long-term gains and losses (assets held > 1 year). Add any qualified dividends if applicable—they're typically taxed at long-term capital gains rates if holding period requirements are met.
Step 4: Add capital loss carryovers from previous years if you have unused losses. Include other ordinary income (W-2 wages, freelance income) to calculate your total tax bracket and determine LTCG rates.
Step 5: Toggle NIIT if your MAGI exceeds thresholds ($200K single / $250K married). Click "Calculate" to see total tax, effective rate, after-tax proceeds, detailed federal/state/NIIT breakdown, netting summary, and carryforward amounts with visual charts.
Strategies to Reduce Capital Gains Taxes
Hold investments > 1 year: The single most impactful strategy. Long-term rates (0-20%) are significantly lower than short-term rates (10-37%). For a taxpayer in the 24% bracket, this saves 9-24 percentage points by waiting just one extra day past the 1-year mark.
Tax-loss harvesting: Realize capital losses to offset gains in the same tax year. Losses first offset gains of the same type (short-term losses → short-term gains), then offset the other type. Remaining losses offset up to $3,000 of ordinary income, with unlimited carryforwards. Beware wash-sale rules: repurchasing a "substantially identical" security within 30 days before/after the sale disallows the loss.
Use the 0% LTCG bracket strategically: In low-income years (retirement, career gap, entrepreneurial startup), intentionally realize long-term gains up to the 0% threshold. This "harvests gains" to step up your cost basis without paying federal capital gains tax.
Asset location optimization: Hold high-turnover investments (actively managed funds, frequent trading) in tax-advantaged accounts (401k, IRA, HSA) where gains aren't taxed annually. Keep buy-and-hold investments in taxable accounts to benefit from long-term rates and step-up in basis at death.
Donate appreciated assets: Donate stocks, crypto, or real estate held > 1 year directly to charities or donor-advised funds. You receive a tax deduction for fair market value AND avoid capital gains tax entirely. More tax-efficient than selling assets and donating cash.
Gift to family in lower brackets: Transfer appreciated assets to children, parents, or relatives in the 0% or 15% capital gains brackets (within annual gift tax limits—verify current limits at irs.gov). They can sell at lower tax rates.
Coordinate with deductions and income timing: Time gain realization with years when you have large deductions (business losses, charitable contributions, mortgage interest). Spread gains across multiple years to avoid "bracket cliffs" and NIIT thresholds.
Detailed Concepts: NIIT, Cost Basis, and Wash Sales
Net Investment Income Tax (NIIT) — 3.8% Surtax
The NIIT is a 3.8% tax on the lesser of: (1) your net investment income (capital gains, dividends, interest, rental income), or (2) the amount your Modified Adjusted Gross Income (MAGI) exceeds thresholds. Thresholds: $200,000 (single), $250,000 (married filing jointly), $125,000 (married filing separately).
Example: Single filer with $220,000 MAGI and $30,000 capital gains
Excess MAGI: $220,000 - $200,000 = $20,000
NIIT base: Lesser of $30,000 (gains) or $20,000 (excess)
NIIT: $20,000 × 3.8% = $760
Cost Basis Tracking Methods
Your cost basis is the original purchase price plus commissions, adjusted for stock splits, return of capital distributions, and reinvested dividends. Brokers offer several accounting methods:
- FIFO (First In First Out): Default method—sells oldest shares first. May result in higher gains if prices have risen.
- LIFO (Last In First Out): Sells newest shares first. Can minimize gains in rising markets.
- Specific Identification: You choose which tax lots to sell. Maximum tax optimization but requires tracking.
- Average Cost: Only for mutual funds. Uses average price of all shares owned.
Special Basis Rules
- Inherited assets: Receive stepped-up basis to fair market value at date of death (major tax benefit).
- Gifted assets: Carryover basis from donor. If FMV is less than donor's basis, special rules apply for losses.
- Wash sales: Disallowed loss adds to basis of replacement shares.
- Stock splits: Basis per share adjusts proportionally (e.g., 2-for-1 split halves per-share basis).
The Wash-Sale Rule Explained
The wash-sale rule disallows capital losses if you purchase a "substantially identical" security within 30 days before or after the sale (61-day window total). The disallowed loss isn't permanently lost—it increases the cost basis of the replacement shares, deferring the tax benefit.
What triggers a wash sale:
- Buying the same stock or security within the 61-day window
- Acquiring substantially identical shares via options, employee stock purchase plans
- Purchasing in a different account (including spouse's accounts)
- Buying in an IRA while selling in taxable account (loss permanently disallowed)
How to avoid: Wait 31+ days before repurchasing, or buy a similar but not identical investment (different company in same sector, or different index fund tracking same market).
Capital Gains by Asset Type
Stocks and ETFs
Stocks and ETFs follow standard short-term (≤1 year) and long-term (>1 year) capital gains rates. ETFs are generally more tax-efficient than mutual funds because of "in-kind" redemptions that don't trigger capital gains distributions. Index ETFs are typically more tax-efficient than actively managed ETFs.
Cryptocurrency
The IRS treats cryptocurrency as property, not currency. Every trade, sale, or purchase using crypto is a taxable event:
- Selling crypto for fiat currency (USD, EUR)
- Trading one crypto for another (e.g., BTC to ETH)
- Purchasing goods or services with crypto
- Receiving crypto as payment (taxed as ordinary income at FMV)
Crypto gifts and donations follow standard rules. Moving crypto between your own wallets is not taxable. Staking rewards and mining income are taxed as ordinary income when received.
Real Estate
Real estate capital gains have special rules:
- Primary residence exclusion: Exclude up to $250,000 (single) or $500,000 (married) if you lived in the home for 2+ of the last 5 years.
- 1031 exchanges: Defer capital gains by exchanging investment property for "like-kind" property within 45/180 day windows.
- Depreciation recapture: Previously deducted depreciation on rental property is recaptured at 25% rate upon sale.
- Opportunity zones: Invest capital gains in qualified opportunity zone funds to defer and potentially reduce taxes.
Collectibles
Art, antiques, precious metals (gold, silver), coins, stamps, and wine are taxed at a maximum 28% rate regardless of holding period. There's no 0% or 15% bracket for collectibles. Long-term gains on collectibles are capped at 28%, but short-term gains are still taxed at ordinary income rates.
Common Capital Gains Mistakes to Avoid
❌ Selling One Day Too Early
Selling an asset after 364 days means short-term rates (up to 37%). Waiting one more day means long-term rates (0-20%). For someone in the 32% bracket with $50,000 in gains, this one-day difference could cost $6,000-$16,000 in extra taxes.
❌ Triggering Wash Sales Accidentally
Many investors harvest losses in December but forget about automatic dividend reinvestment, which can trigger a wash sale if it purchases shares within 30 days. Also watch for purchases in retirement accounts—a wash sale between taxable and IRA accounts permanently disallows the loss.
❌ Ignoring State Capital Gains Taxes
Some states tax capital gains at high rates (California 13.3%, New York 10.9%), while others have no capital gains tax (Texas, Florida, Washington on most gains). When planning large sales, consider the state tax impact—it can be larger than federal tax for high earners in high-tax states.
❌ Forgetting About NIIT
The 3.8% Net Investment Income Tax surprises many investors. If your MAGI exceeds $200,000 (single) or $250,000 (married), factor NIIT into your planning. It applies to capital gains, dividends, interest, and rental income.
❌ Not Using Specific Identification
Default FIFO accounting may not be optimal. If you've bought the same stock at different prices, choosing which lots to sell (specific identification) can minimize taxes. Most brokerages support this—you just need to designate lots before selling.
❌ Realizing Too Many Gains in One Year
Large capital gains can push you into higher tax brackets and trigger NIIT. Consider spreading gains across multiple tax years when possible. This is especially important near bracket thresholds or the NIIT income limits.
Frequently Asked Questions
Do I owe taxes if I haven't sold anything?
No. Capital gains tax is only triggered when you realize a gain by selling, exchanging, or otherwise disposing of an asset. Unrealized gains (paper profits) are not taxed. However, mutual funds may distribute capital gains to shareholders even if you didn't sell your shares.
How do capital gains affect my tax bracket?
Long-term capital gains have their own rate structure (0%, 15%, 20%) but are added on top of your ordinary income when determining which LTCG bracket applies. Your ordinary income "fills up" lower brackets first, then capital gains are taxed at the rate corresponding to your total income level.
Can I offset capital gains with losses from previous years?
Yes. Capital loss carryforwards from previous years can offset gains in the current year with no limit. Losses first offset gains of the same type (short-term vs long-term), then offset the other type, then offset up to $3,000 of ordinary income. Unused losses carry forward indefinitely.
Are qualified dividends taxed as capital gains?
Yes, qualified dividends from US corporations and qualified foreign corporations are taxed at the same preferential rates as long-term capital gains (0%, 15%, or 20%). However, you must meet the holding period requirement: hold the stock for more than 60 days during the 121-day period surrounding the ex-dividend date.
What if I inherit investments with gains?
Inherited assets receive a stepped-up basis to fair market value at the date of death. This eliminates capital gains that accrued during the decedent's lifetime. If you sell immediately after inheriting, you'll have little or no gain. This is one of the most valuable tax benefits in the tax code.
How does the 0% capital gains rate work?
If your taxable income (including long-term gains) falls within the 0% bracket threshold—approximately $47,000 for single filers or $94,000 for married filing jointly (verify current amounts at irs.gov)—your long-term capital gains are taxed at 0%. This makes it possible to realize gains completely tax-free in low-income years, such as early retirement, career transitions, or while a student.
Sources & References
Capital gains tax rates and thresholds referenced in this content are based on official IRS publications:
- IRS Tax Topic 409 - Capital gains and losses overview
- IRS Publication 550 - Investment income and expenses
- IRS Tax Topic 559 - Net Investment Income Tax (NIIT) thresholds
- IRS Publication 544 - Sales and other dispositions of assets
- IRS Publication 523 - Selling your home (primary residence exclusion)
- IRS Tax Topic 703 - Wash sale rule
Capital gains tax brackets are adjusted annually for inflation. Always verify current thresholds at irs.gov before making investment decisions.
For Educational Purposes Only - Not Financial Advice
This calculator provides estimates for informational and educational purposes only. It does not constitute financial, tax, investment, or legal advice. Results are based on the information you provide and current tax laws, which may change. Always consult with a qualified CPA, tax professional, or financial advisor for advice specific to your personal situation. Tax rates and limits shown should be verified with official IRS.gov sources.
Frequently Asked Questions
What's the difference between short-term and long-term capital gains?
Short-term capital gains are profits from selling assets held for one year or less, and are taxed as ordinary income at your marginal tax rate (10% to 37%). Long-term capital gains are from assets held for more than one year, and receive preferential tax rates of 0%, 15%, or 20% depending on your taxable income and filing status. For example, a taxpayer in the 24% bracket pays 24% on short-term gains but only 15% on long-term gains—a significant 9 percentage point difference. The holding period is calculated from the day after purchase to the sale date.
How do the 0%, 15%, and 20% long-term capital gains brackets work?
Long-term capital gains tax brackets are based on your total taxable income (including the gains themselves). For 2025 estimates: The 0% rate applies if taxable income is up to ~$47,025 (single) or ~$94,050 (married filing jointly). The 15% rate applies from ~$47,026 to ~$518,900 (single) or ~$94,051 to ~$583,750 (married). The 20% rate applies above those thresholds. These brackets are separate from ordinary income tax brackets and adjust annually for inflation. Unlike ordinary income which is taxed progressively across multiple brackets, capital gains are typically taxed at one rate based on your total income level.
What is NIIT (Net Investment Income Tax) and when does it apply?
The Net Investment Income Tax (NIIT) is a 3.8% surtax on investment income including capital gains, dividends, interest, rental income, and passive business income. It applies when your Modified Adjusted Gross Income (MAGI) exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately). You pay NIIT on the lesser of: (1) your net investment income, or (2) the amount your MAGI exceeds the threshold. Example: Single filer with $220,000 MAGI and $30,000 capital gains pays NIIT on only $20,000 (the MAGI excess) = $760. The NIIT applies to both short-term and long-term gains and is in addition to regular capital gains tax.
How does the $3,000 capital loss deduction work, and what about carryforwards?
Capital losses first offset capital gains of the same type (short-term losses → short-term gains, long-term losses → long-term gains), then offset the opposite type. After offsetting all gains, you can deduct up to $3,000 ($1,500 if married filing separately) of remaining net capital losses against ordinary income each year. Any losses exceeding $3,000 carry forward indefinitely to future tax years. Example: $50,000 capital loss with no gains. Year 1: deduct $3,000 against ordinary income, carry forward $47,000. Year 2: deduct $3,000, carry forward $44,000. Continue until exhausted. You report carryforward losses on Form 1040 Schedule D. There's no expiration—losses carry forward until used or death.
What are wash-sale rules and how do they affect my taxes?
The wash-sale rule disallows capital loss deductions if you purchase a substantially identical security within 30 days before or after the sale (61-day window total). The disallowed loss isn't permanently lost—it's added to the cost basis of the replacement shares, deferring the tax benefit. Example: Sell 100 shares of Stock A for a $1,000 loss on December 15. Buy 100 shares of Stock A on December 20. The $1,000 loss is disallowed in the current year but increases the basis of the new shares by $1,000. To avoid wash sales: (1) Wait 31+ days before repurchasing the same security, (2) Buy a similar but not identical investment (different company in the same sector, or an index ETF instead of individual stocks), or (3) Use the loss to offset gains without repurchasing. Important: Wash sales also apply if you buy the security in an IRA within 30 days of selling in a taxable account—this permanently disallows the loss.
How are qualified dividends taxed?
Qualified dividends are taxed at the preferential long-term capital gains rates (0%, 15%, or 20%) rather than as ordinary income. To qualify, dividends must be paid by a U.S. corporation or qualified foreign corporation, and you must hold the stock for more than 60 days during the 121-day period beginning 60 days before the ex-dividend date. Most dividends from stocks held in regular brokerage accounts for several months meet these requirements. Non-qualified (ordinary) dividends are taxed at regular income tax rates and include: dividends from REITs, MLPs, and foreign corporations in certain countries, dividends on stocks held less than 61 days, and dividends from tax-exempt organizations. Qualified dividends are also subject to the 3.8% NIIT when MAGI exceeds thresholds.
Do states tax capital gains differently?
Yes, state capital gains tax treatment varies significantly. Some states have no income tax at all (Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming), so capital gains are not taxed at the state level. Most states tax capital gains as ordinary income at their standard income tax rates—California (up to 13.3%), New York (up to 10.9%), Oregon (up to 9.9%). A few states offer preferential rates or exclusions for certain capital gains. Washington state has a 7% capital gains tax on gains exceeding $250,000 (individual). Some states allow deductions for retirement account contributions or other adjustments that reduce taxable capital gains. High-income earners can save 10%+ on investment gains by residing in no-tax states. State residency for tax purposes is determined by domicile and physical presence rules, not just where you sell the investment.
Related Financial Calculators
Salary / Take-Home Pay Calculator
Estimate net pay after taxes and deductions to understand your total income for tax planning.
Self-Employed / 1099 Tax Calculator
Calculate self-employment tax and quarterly payment estimates for freelancers and contractors.
Cost of Living Calculator
Compare cities to plan after-tax lifestyle costs when relocating for better tax treatment.
Retirement Savings Calculator
Project 401(k)/IRA growth and see how capital gains in retirement accounts grow tax-deferred.
Emergency Fund Planner
Target 3–6 months of expenses and ensure liquidity before investing in taxable accounts.
Budget & Subscription Tracker
Track expenses to find additional funds for tax-advantaged investing and offset future gains.
Capital Loss Harvesting Helper
Identify positions with unrealized losses to offset gains and reduce your tax liability.
Tax-Equivalent Yield Calculator
Compare municipal bond yields to taxable bonds by calculating the equivalent pre-tax yield.
Stock Target CAGR Calculator
Calculate the compound annual growth rate needed for a stock to reach your target price.
Marginal vs Effective Tax Rate Visualizer
Understand how capital gains affect your marginal and effective tax rates across income levels.