Capital Gains Tax Calculator
How to Use This Calculator
- 1
Enter Sale Proceeds and Cost Basis
Use the sale price and the original purchase price plus transaction costs. The calculator treats a sale below basis as a zero gain, not a deductible capital loss.
- 2
Enter your income, filing status, holding period, and State Tax Rate
Other Taxable Income is your taxable income before the gain. Choose Long-Term for an asset held over one year or Short-Term for one held one year or less. Enter 0% if your state does not tax capital gains.
- 3
Review the tax breakdown
The results estimate federal tax, the Net Investment Income Tax (NIIT) when applicable, state tax, and the amount of the gain left after those taxes.
Example Calculation
A single filer with $80,000 of other taxable income sells an investment for $50,000 after buying it for $30,000. The asset was held long-term, and the state tax rate entered is 5%.
Sale Proceeds ($)
50,000
Cost Basis ($)
30,000
Other Taxable Income ($)
80,000
State Tax Rate (%)
5
Holding Period
Long-Term (held over 1 year)
Filing Status
Single
Results
Total Capital Gains Tax
$4,000.00
Capital Gain
$20,000.00
Federal Tax Rate
15%
Net Profit After Tax
$16,000.00
Insights card shows the federal, NIIT, state, and net-profit breakdown.
Tips
Changing the holding period can raise the estimated federal rate from 15% to 22%
For the example inputs, switch Holding Period to Short-Term. The gain is then taxed at the ordinary-income rate selected for the combined income; the estimate becomes $5,400 in total tax with a 22% federal rate and the same 5% state rate.
Setting State Tax Rate to 0% removes $1,000 from the example estimate
Change State Tax Rate from 5% to 0% to see the state portion disappear. Check your state's rules before entering zero; some states tax capital gains as ordinary income.
Test a higher income to see when NIIT enters the estimate
Raise Other Taxable Income above $180,000 for a single filer while keeping the gain at $20,000. The calculator's combined-income estimate then exceeds its $200,000 NIIT threshold.
What this calculator estimates
Capital gains tax is the estimated tax on the profit from selling an asset. This calculator estimates federal tax, a state tax amount based on the rate you enter, and NIIT when its simplified income test is met; it does not calculate deductible losses, tax credits, or every adjustment on a tax return.
How the calculation works
Gain = max(0, Sale Proceeds − Cost Basis)
Combined income = Other Taxable Income + Gain
Federal tax = Gain × selected federal rate
NIIT = min(Gain, max(0, Combined income − NIIT threshold)) × 3.8%
State tax = Gain × State Tax Rate
Total estimated tax = Federal tax + NIIT + State tax
Net profit after tax = Gain − Total estimated tax
For the example, the gain is $50,000 − $30,000 = $20,000. Combined income is $80,000 + $20,000 = $100,000, which selects a 15% long-term federal rate in the calculator's bracket logic. Federal tax is $20,000 × 0.15 = $3,000; the combined income is below the single-filer NIIT threshold, so estimated NIIT is $0. State tax is $20,000 × 0.05 = $1,000. Total estimated tax is $3,000 + $0 + $1,000 = $4,000, leaving $20,000 − $4,000 = $16,000.
Federal long-term rates and thresholds can change by tax year. The IRS's capital gains and losses guidance explains holding periods and federal treatment. This calculator applies the selected rate to the full gain rather than calculating tax bracket by bracket, and its NIIT estimate uses taxable income as a stand-in for modified adjusted gross income.
How holding period and state rate change the estimate
Short-term gains are generally taxed using ordinary-income rates, while qualifying long-term gains use special federal brackets. The table holds the example's gain, income, and state rate constant; it illustrates the calculator's estimated outcome.
| Holding period and state rate | Federal rate used | Estimated federal tax | State tax | Estimated total |
|---|---|---|---|---|
| Long-term, 5% state rate | 15% | $3,000 | $1,000 | $4,000 |
| Short-term, 5% state rate | 22% | $4,400 | $1,000 | $5,400 |
| Long-term, 0% state rate | 15% | $3,000 | $0 | $3,000 |
The actual decision is not only about tax. Selling can lock in a gain and change your portfolio risk; holding can defer tax but leave more money exposed to that asset's price changes. Compare the tax estimate with your investment plan and verify state rules before selling.
When to use a different calculator
- Estimate gain on a home sale → capital gains on home sale calculator
- Estimate tax on a real-estate sale → capital gains tax calculator for real estate
- Check whether an exemption may apply → capital gains exemption calculator
- Compare gain with the original investment amount → capital gains yield calculator
Frequently Asked Questions
What is capital gains tax?
Capital gains tax is tax on the profit from selling an asset for more than its tax basis. Federal tax treatment depends in part on how long you held the asset, and state rules vary. The IRS explains the holding-period distinction in its capital gains and losses guidance.
How do I calculate capital gains tax?
1. Subtract Cost Basis from Sale Proceeds to find the gain. 2. Add the gain to your other taxable income to estimate the applicable federal rate. 3. Multiply the gain by the federal rate, add any NIIT and state tax, and subtract total tax from the gain to estimate net profit.
When does the Net Investment Income Tax apply?
The NIIT can apply when modified adjusted gross income exceeds a filing-status threshold and the taxpayer has net investment income. The tax is 3.8% on the lesser of net investment income or the amount above the threshold; this calculator approximates the test using combined income and the gain. See the IRS's Net Investment Income Tax guidance.
Does this calculator determine whether I owe tax on a capital loss?
No; it sets a sale below cost basis to a zero gain, so it does not calculate deductible losses or loss carryovers. Tax rules for capital losses depend on your other gains, income, and prior-year carryovers; the IRS explains them in its capital gains and losses guidance.
Does selling after one year always mean a 15% tax rate?
No; long-term gains can fall into different federal rate brackets, including 0%, 15%, or 20%, depending on taxable income and filing status. The calculator estimates one rate for the entire gain, so it does not reproduce a complete tax return or every special rate rule.
