US Capital Gains Tax Calculator
Calculate US federal capital gains tax on stocks, real estate, and other assets — with LTCG 0%/15%/20% rates and STCG ordinary income rates for 2024.
Did this tool work for you?
How to use this calculator
- 1
Enter the sale price and your cost basis (purchase price plus commissions, fees, and improvements for real estate).
- 2
Enter holding period in months — over 12 months qualifies for lower long-term rates.
- 3
Enter your other ordinary income — this determines which LTCG bracket you fall into.
- 4
High earners may also owe the 3.8% Net Investment Income Tax (NIIT) on investment gains.
Frequently asked questions
What are the 2024 long-term capital gains tax rates?
0% rate: income up to $47,025 (single) or $94,050 (MFJ). 15% rate: income between $47,025–$518,900 (single) or $94,050–$583,750 (MFJ). 20% rate: income above $518,900 (single) or $583,750 (MFJ). High earners may also owe the 3.8% NIIT on top of these rates.
What is the Net Investment Income Tax (NIIT)?
The NIIT is a 3.8% surtax on investment income (capital gains, dividends, interest, rental income) for high earners — single filers with modified AGI above $200,000 and MFJ above $250,000. It applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold.
Is real estate subject to capital gains tax?
Yes, but with a major exclusion: if you've lived in your primary home for at least 2 of the last 5 years, you can exclude up to $250,000 of gain ($500,000 MFJ) from capital gains tax. Gains above the exclusion are taxed at LTCG rates. Investment properties don't qualify for this exclusion.
Can I offset capital gains with losses?
Yes — this is called "tax-loss harvesting." Capital losses first offset capital gains of the same type (STCL against STCG, LTCL against LTCG), then offset either type. Net capital losses up to $3,000 can be deducted against ordinary income annually; any unused loss carries forward to future years.
US Capital Gains Tax Calculator 2024 — LTCG 0%/15%/20% rates
Why holding period matters so much
Selling stock after 12 months vs. at 11 months can be the difference between a 0–20% tax rate and a 22–37% rate. On a $50,000 gain, that's potentially $10,000+ in extra taxes for selling one month early. Always calculate your holding period before selling appreciated investments.
Tax-loss harvesting strategy
If you have unrealized losses in your portfolio, you can sell those positions to generate capital losses that offset your capital gains — reducing or eliminating your tax liability. Wash-sale rule: you cannot repurchase the same or "substantially identical" security within 30 days before or after the sale or the loss is disallowed.
Learn more from an authoritative source:
InvestopediaUS Sales Tax Calculator
Calculate the total price including sales tax for any US state — or work backwards to find the pre-tax price from a total.
Self-Employment Tax Calculator
Calculate self-employment (SE) tax, the deductible half, and net income for freelancers, 1099 contractors, and small business owners.
US Mortgage Calculator
Calculate your monthly mortgage payment with PITI — principal, interest, property taxes, insurance, and optional PMI — for any US home loan.
Student Loan Payoff Calculator
Calculate your monthly student loan payment, total interest, and payoff date — with comparison of standard, extended, and income-driven repayment plans.
Debt-to-Income Ratio Calculator
Calculate your front-end and back-end DTI ratio — the key metric lenders use to determine mortgage and loan eligibility.
W-4 Withholding Calculator
Estimate your federal tax withholding and check if you are over- or under-withholding — so you get neither a surprise bill nor a large refund at tax time.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →