Capital Gains Tax Calculator
Estimate capital gains tax on the sale of stocks, real estate, or other assets. Short-term vs long-term rates, plus the Net Investment Income Tax (NIIT), included.
Asset Details
Tax Details
Net Investment Income Tax (NIIT)
Capital Gain
$15,000
Federal Tax
$2,250
State Tax
$0
NIIT
$0
Net Profit
$12,750
Federal Rate
Effective Rate
How to Use This Tool
Enter the purchase price (cost basis).
Enter the purchase price (cost basis).
Enter the sale price.
Enter the sale price.
Pro Tip
Before selling any appreciated asset near the one-year holding mark, calculate both the short-term and long-term tax scenarios explicitly — the difference between ordinary income rates and preferential long-term capital gains rates is often large enough that waiting even a few weeks to cross the threshold can be worth thousands of dollars in tax savings. If your MAGI is anywhere near $200,000 (single) or $250,000 (MFJ), also check the NIIT card — it's easy to forget this 3.8% surtax stacks on top of your regular capital gains rate.
About This Tool
When to Use
- An investor deciding whether to hold a stock a few more weeks to cross the one-year mark and qualify for long-term rates.
- A homeowner selling their primary residence checking their gain against the capital gains exclusion threshold before entering numbers.
- Someone comparing the tax bill on an identical $20,000 profit taxed at short-term versus long-term capital gains rates.
How It Works
Enter the purchase price, sale price, holding period, your approximate income bracket, and your state. The tool computes the gain (sale minus purchase) and applies a flat federal rate based on your br...
Key Details
The capital gains tax calculator estimates federal, state, and NIIT tax owed on the profit from selling an asset — stocks, real estate, or other investments — distinguishing between short-term gains (...
How it works
Enter the purchase price, sale price, holding period, your approximate income bracket, and your state. The tool computes the gain (sale minus purchase) and applies a flat federal rate based on your bracket and holding period — 0%/15%/15%/20% long-term (now aligned to the real 2026 thresholds) or 10%/22%/32%/35% short-term for the Low/Medium/High/Very High tiers respectively — plus a flat state-rate estimate. Separately, enter your MAGI (including this gain) and filing status; the calculator applies 3.8% NIIT to whichever is smaller, this gain or the amount your MAGI exceeds $200,000 (single) / $250,000 (MFJ). Federal tax, state tax, and NIIT are summed into total tax, effective rate, and net profit.
Worked example
An investor sells stock held for 8 months with a $20,000 profit. In this calculator's "High" income bracket, that's taxed at the short-term rate of 32%, owing $6,400 in tax. Had they instead waited until the 13-month mark to sell, the identical $20,000 gain would qualify for that bracket's long-term rate of 15%, owing only $3,000 — a $3,400 tax savings purely from waiting a few extra months to cross the one-year holding threshold. Separately, a single filer with $300,000 MAGI selling a $50,000 long-term gain in the Very High bracket owes $10,000 in federal tax (20%) plus $1,900 in NIIT (3.8% of the full $50,000 gain, since the $100,000 MAGI overage exceeds it).
Interpreting your result
Federal long-term rates now match the real 2026 IRS thresholds across all four brackets, so pick whichever bracket actually contains your taxable income rather than defaulting to a rough guess. Short-term rates remain a four-bucket simplification of the real seven-bracket ordinary income schedule — accurate at each bucket's edges but approximate in between, since ordinary income tax has more gradations than this tool's four tiers. The bracket boundaries themselves reflect single-filer thresholds; married filers should still pick the bracket matching their actual taxable income, since the real MFJ thresholds run higher (e.g. 0% up to $98,900, not $49,450).
Capital Gains Tax Calculator FAQ
Does this calculator use the real, current 2026 capital gains tax thresholds?
Yes. Its four income brackets are now drawn directly from the genuine 2026 IRS long-term capital gains thresholds (single filer, verified via live search): Low $0–$49,450 (0% long-term rate), Medium $49,451–$105,700 (15%), High $105,701–$545,500 (15%), and Very High $545,501+ (20%). Because Medium and High share the same 15% rate across their combined $49,451–$545,500 span, and Very High starts exactly at the real 20% breakpoint, selecting the bracket that matches your actual taxable income now produces the correct long-term rate at every income level — including the top end, which previously applied 20% more than $350,000 too early.
What is the difference between short-term and long-term capital gains?
Short-term: assets sold within 12 months of purchase. Gains taxed as ordinary income (10–37%). Long-term: assets held for more than 12 months. Gains taxed at 0%, 15%, or 20% — significantly lower than ordinary income rates. Using this calculator's own "High" income bracket (its rates for that tier: 32% short-term, 15% long-term) on a $20,000 gain: short-term tax = $6,400; long-term tax = $3,000. Waiting one more day past the 12-month mark can save thousands.
Is there a capital gains tax exemption on home sales?
Yes — the Section 121 exclusion allows single filers to exclude up to $250,000 in home sale gains from taxable income ($500,000 for married filing jointly), provided you owned and used the home as your primary residence for at least 2 of the last 5 years. Example: buy for $300,000, sell for $600,000 ($300,000 gain). Single filer: $300,000 - $250,000 exclusion = $50,000 taxable. MFJ: entire $300,000 gain is excluded. Note: this calculator doesn't have a dedicated home-sale exclusion input — manually subtract your exclusion from the gain before entering the sale price and purchase price.
What is the Net Investment Income Tax (NIIT), and does this calculator include it?
Yes — this calculator now computes it directly. The NIIT is a real additional 3.8% federal tax on net investment income (including capital gains) once your Modified AGI crosses $200,000 (single) or $250,000 (married filing jointly). Enter your MAGI for the year (including this gain) and your filing status, and the calculator applies 3.8% to whichever is smaller: this gain, or the amount your MAGI exceeds your threshold. Example: a single filer with $230,875 MAGI and a $50,000 gain owes $1,173.25 in NIIT (3.8% of the $30,875 by which MAGI exceeds $200,000, since that's less than the $50,000 gain).
What counts as the cost basis for capital gains?
Cost basis is what you paid for the asset, including commissions and fees. For stocks: purchase price + brokerage fees. For real estate: purchase price + closing costs + capital improvements (not maintenance). For inherited assets: step-up in basis to fair market value at date of death (a major tax advantage). If you received the asset as a gift: generally the donor's original basis carries over.
What is tax-loss harvesting and how does it reduce capital gains tax?
Tax-loss harvesting means selling investments at a loss to offset realized gains in the same tax year. If you realize $15,000 in capital gains and sell a losing position for a $10,000 loss, your net taxable gain is only $5,000. Unused losses can offset up to $3,000 of ordinary income per year, with excess losses carried forward indefinitely. The wash-sale rule prohibits repurchasing the same security within 30 days before or after the sale.
Master Your Entire Toolkit
Access 500+ specialized calculators and tools designed for precision. No sign-up required, 100% free.
Built and reviewed by the Toolzip Team · Based on IRS Capital Gains and IRS Topic no. 559 — Net Investment Income Tax