Free to use. Paste this where you want the calculator to appear.
How to calculate capital gains tax
Gain = sale price − what you paid − fees
Long-term gains sit on top of your taxable income: 0% up to $49,450 single in 2026, 15% up to $545,500, 20% above
Short-term gains are taxed at your income tax brackets
3.8% net investment income tax on gains above $200,000 of income ($250,000 joint)
Example: Single with $60,000 of other income, a $10,000 long-term gain in 2026 adds $667.50 of tax: $5,550 at 0% and $4,450 at 15%. Sold within a year, the same gain adds $1,550.00.
About the Capital Gains Tax Calculator
The federal tax on selling stock, crypto, a business or property: long-term gains at the real 0%, 15% and 20% rates on top of your income, short-term gains at your bracket, and the 3.8% investment income tax.
How to use this tool
Enter what you paid, what you sold it for and any fees.
Choose whether you held it more than a year.
Pick your filing status and enter your other income for the year.
Frequently asked questions
What are the 2027 capital gains tax brackets?
Long-term gains are taxed 0% while taxable income is up to $51,050 single, $102,100 married filing jointly or $68,350 head of household; 15% up to $563,200, $633,600 and $598,400; and 20% above (IRS Rev. Proc. 2026-35).
What are the 2026 capital gains tax brackets?
0% up to $49,450 of taxable income single, $98,900 married filing jointly or $66,200 head of household; 15% up to $545,500, $613,700 and $579,600; 20% above (Rev. Proc. 2025-32).
What is the difference between short-term and long-term gains?
Assets held more than a year are long-term and taxed at 0%, 15% or 20%. Assets held a year or less are short-term and taxed at your income tax brackets, like wages.
How is the gain calculated?
Gain = what you sold it for − what you paid, counting purchase and sale fees and the cost of improvements.
Can I pay 0% on capital gains?
Yes, on the part of a long-term gain that fits under the 0% line. Married filing jointly with $80,000 of other income, a $20,000 long-term gain in 2027 is taxed $20,000 at 0%: $0.00 in all.
Can losses reduce my tax?
Yes. Losses offset gains, and up to $3,000 of net loss a year ($1,500 if married filing separately) can offset other income. The rest carries forward.
What is the 3.8% net investment income tax?
An extra 3.8% on investment income, including capital gains, once modified AGI is over $200,000 single or head of household, $250,000 married filing jointly or $125,000 married filing separately. Those lines are not indexed for inflation.