Wages, business income, etc. Used to determine your capital gains bracket and NIIT applicability.
Most states tax capital gains as ordinary income. Enter 0 for no-income-tax states (TX, FL, WA, etc.).
Your Results
Enter purchase and sale details to calculate.
Embed This Calculator on Your Website
Add this free calculator to your blog, website, or CMS with a simple copy-paste embed code.
What This Calculator Does
This capital gains tax calculator estimates the federal, state, and Net Investment Income Tax (NIIT) on profits from selling investments, real estate, or other capital assets. It distinguishes between short-term gains (taxed as ordinary income) and long-term gains (taxed at preferential 0%, 15%, or 20% rates). The tool uses 2026 projected federal thresholds, accounts for the 3.8% NIIT on high earners, and includes state-level capital gains tax based on your entered rate.
The Formula
The capital gain is the difference between the sale price and the cost basis (original purchase price plus improvements). Short-term gains (assets held one year or less) are taxed at ordinary income rates up to 37% in 2026. Long-term gains (held over one year) are taxed at 0%, 15%, or 20% depending on total taxable income. The Net Investment Income Tax adds 3.8% on investment income for taxpayers with modified adjusted gross income (MAGI) above $200,000 (single) or $250,000 (married filing jointly). Most states tax capital gains as ordinary income.
Step-by-Step Example
Enter purchase and sale prices
Purchase: $50,000. Sale: $80,000. Capital gain: $30,000.
Select holding period and filing status
Long-term (held over 1 year), single filer.
Enter other income and state rate
Other taxable income: $75,000. State rate: 5%.
Review tax breakdown
Federal: $4,500 (15%). NIIT: $190 (3.8% on $5,000 above threshold). State: $1,500. Total: $6,190. Net proceeds: $73,810.
Real-World Use Cases
Stock Sale Planning
Calculate the tax impact before selling investments to determine whether the after-tax return justifies the sale.
Real Estate Capital Gains
Estimate taxes on the sale of rental property or a second home to plan for tax liability at closing.
Tax-Loss Harvesting
Understand how realized gains interact with your income to optimize when to harvest losses to offset gains.
Common Mistakes to Avoid
Not accounting for the holding period. The difference between short-term (up to 37%) and long-term (up to 20%) rates can be enormous. Holding for one year and one day saves thousands on large gains.
Forgetting the NIIT. High earners pay an additional 3.8% on the lesser of net investment income or MAGI above the threshold, which can push the effective rate to 23.8% plus state tax.
Using the wrong cost basis. Inherited assets receive a stepped-up basis to fair market value at date of death. Gifted assets carry over the donor cost basis. Stock splits and reinvested dividends also adjust basis.
Not considering the primary residence exclusion. Single filers can exclude up to $250,000 and married filers up to $500,000 of gain on a primary residence (IRC Section 121) if ownership and use tests are met.
Frequently Asked Questions
Accuracy and Disclaimer
Capital gains tax calculations are based on 2026 projected federal thresholds and rates. Actual liability depends on your complete tax situation including other income, deductions, credits, and state-specific rules. This calculator does not account for depreciation recapture, qualified opportunity zone deferrals, or installment sale treatment. Consult a licensed tax professional for investment tax planning.
Related Calculators
Self-Employment Tax Calculator
Calculate Social Security, Medicare, and federal income tax on self-employment income using 2026 IRS rates and brackets.
Use CalculatorTax & Payroll1099 vs W-2 Comparison Calculator
Compare take-home pay, tax burden, and total compensation between W-2 employment and 1099 self-employment.
Use CalculatorTax & PayrollQuarterly Estimated Tax Calculator
Calculate quarterly estimated tax payments with safe harbor amounts and 2026 IRS deadlines.
Use Calculator