About the Capital Gains Tax Calculator
In the U.S., a capital gain is the profit from selling an asset for more than your cost basis. How much tax applies depends mainly on the holding period: assets held more than one year usually qualify for lower long-term rates of 0%, 15%, or 20%, while short-term gains are taxed at the same rates as wages.
The calculator uses the published IRS brackets for the tax year you select, stacks the gain on top of your other taxable income, and adds the 3.8% Net Investment Income Tax when your income is above the threshold. Results are estimates, not tax advice.
How It Works
The capital gain is the sale price minus the purchase price (your cost basis). Include purchase commissions in the basis and selling costs by reducing the sale price if you want them reflected.
Long-term gains fill the 0%, 15%, and 20% bands in order, starting after your other taxable income. Short-term gains are added to your other taxable income and taxed at ordinary income rates. Collectibles held long-term use ordinary rates capped at 28%. For a primary residence held long-term, the home-sale exclusion ($250,000, or $500,000 for joint filers) is subtracted first, assuming you meet the ownership and use tests.
State tax is calculated only where verified data is available. For other states you can enter your own estimated rate, which is clearly labelled as your assumption.
Formula
- T0maximum 0% rate amount for your filing status (e.g. $49,450 single, 2026)
- T15maximum 15% rate amount (e.g. $545,500 single, 2026)
Thresholds by filing status and year come from the centralized tax data (IRS Rev. Proc. 2024-40 for 2025 and Rev. Proc. 2025-32 for 2026).
Example
A single filer with $60,000 of other taxable income sells shares bought for $20,000 at $50,000 after holding them for more than a year (2026 tax year).
Inputs
- Gain
- $30,000
- Holding period
- Long-term
- Other taxable income
- $60,000
- State
- Florida (no income tax)
Results
- Estimated federal tax
- $4,500.00
- Effective rate
- 15.00%
- Net gain after tax
- $25,500.00
Because $60,000 of other income is already above the 2026 0% threshold of $49,450, the whole gain falls in the 15% band. If the same shares had been held one year or less, the gain would be taxed at 22% ordinary rates — about $6,600.
Assumptions & Limitations
- Tax year: brackets, thresholds and exclusions come only from the tax year you select. Years are never mixed.
- Other taxable income is treated as ordinary income after deductions; qualified dividends and other capital gains are not modelled separately.
- NIIT uses taxable income as a stand-in for modified adjusted gross income, which may understate it.
- Not included: depreciation recapture on real estate (up to 25%), capital loss carryovers, the alternative minimum tax, credits, and wash-sale rules.
- State tax: calculated only for states with verified data; otherwise shown as not available unless you enter your own rate.
Understanding Your Results
- Estimated Total Tax: Federal capital gains tax plus NIIT plus state tax where available.
- Effective Tax Rate: Total estimated tax as a percentage of the gain.
- Net Gain After Estimated Tax: What remains of the gain after the estimated taxes.
- Bracket chart: Shows how much of the gain falls into each federal rate band.