Capital Gains Tax Calculator
capital_gains_taxCompute federal capital gains tax including Net Investment Income Tax and optional state income tax for 2026. Input gain, ordinary taxable income, filing status, and term for estimates.
Instructions
Computes federal capital gains tax (long-term 0%/15%/20% stacked bands or short-term ordinary rates), the 3.8% Net Investment Income Tax (NIIT) above the MAGI threshold, and an optional state income tax on the gain (states generally tax capital gains as ordinary income). Example input: { "gain": 50000, "ordinaryTaxableIncome": 80000, "filingStatus": "single", "term": "long" }. 2026 tax year — estimates, not tax advice; thresholds from Rev. Proc. 2025-32, cross-checked against Tax Foundation & Schwab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gain | Yes | Gross capital gain in USD (sale price minus cost basis), e.g. 50000. | |
| term | Yes | "long" for assets held > 1 year (preferential rates), "short" for ordinary rates. | |
| state | No | Optional two-letter US state or DC postal code; most states tax the gain as ordinary income. | |
| exclusion | No | Amount excluded from the gain before tax (e.g. the §121 primary-residence sale exclusion). | |
| filingStatus | Yes | IRS filing status. | |
| ordinaryTaxableIncome | Yes | Other taxable income (excluding the gain), which sets the long-term capital gains bracket and NIIT threshold. |