Skip to main content
All Tools
calculator

Capital Gains Tax Calculator

HA

Reviewed by Harsh Agarwal, EA (#00158482)

Description

The Capital Gains Tax Calculator helps investors, property owners, and cryptocurrency holders estimate the federal tax owed on gains from selling capital assets such as stocks, bonds, mutual funds, real estate, and digital assets. Capital gains taxation is one of the most important — and most frequently misunderstood — areas of U.S. tax law, with rates varying significantly based on the type of asset, how long you held it, your overall income level, and your filing status. This calculator handles both short-term capital gains (assets held one year or less, taxed as ordinary income at your marginal rate) and long-term capital gains (assets held more than one year, taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income). The calculator also accounts for the Net Investment Income Tax (NIIT) — a 3.8% surtax on investment income for taxpayers with modified adjusted gross income exceeding $200,000 (single) or $250,000 (married filing jointly) — which can increase the effective tax rate on capital gains to as high as 23.8% for the highest earners. For real estate gains, the calculator includes special handling for the primary residence exclusion under IRC Section 121 ($250,000 single / $500,000 married filing jointly), depreciation recapture taxed at 25% under Section 1250, and the installment sale method for gains received over multiple years. For international investors and expats, the calculator addresses the interaction between capital gains and the Foreign Tax Credit, helping you understand how foreign taxes paid on asset sales can offset your U.S. capital gains tax liability. The calculator also handles the unique treatment of collectibles (taxed at 28%), qualified small business stock (potential exclusion under Section 1202), and wash sale adjustments that may affect your cost basis.

Input Fields

For accurate results, book a consultation with our tax professionals.

Formula Explanation

Capital gain = Sale Proceeds - Cost Basis. For short-term gains: taxed as ordinary income at your marginal tax rate. For long-term gains: taxed at 0% (taxable income up to approx $47,025 single), 15% (up to approx $518,900 single), or 20% (above approx $518,900 single). NIIT of 3.8% applies if MAGI exceeds $200,000 (single) / $250,000 (MFJ). Total capital gains tax = applicable rate x capital gain + NIIT if applicable.

Example Calculation

Example: Single filer sells stock for $50,000 with $30,000 cost basis, held for 2 years, with $85,000 in other taxable income. Step 1: Capital gain = $50,000 - $30,000 = $20,000 (long-term) Step 2: Total income = $85,000 + $20,000 = $105,000 Step 3: Long-term capital gains rate at $105,000 income = 15% Step 4: Capital gains tax = $20,000 x 15% = $3,000 Step 5: NIIT check: MAGI of $105,000 < $200,000 threshold = No NIIT Step 6: Total federal tax on the capital gain = $3,000 If this were a short-term gain instead, it would be taxed at the ordinary rate of 22%, resulting in $4,400 in tax — $1,400 more than the long-term rate.

Important Disclaimers

  • This calculator provides estimates based on current federal capital gains tax rates. Actual tax may differ due to state capital gains taxes, the interaction with other income and deductions, the impact of the AMT, special asset types (collectibles, QSBS, Section 1250 recapture), and carryover losses from prior years. This tool does not account for state taxes on capital gains, which vary by state. This is for informational purposes only and does not constitute tax advice.

Frequently Asked Questions

What is the 0% capital gains tax rate and who qualifies?
The 0% long-term capital gains rate applies to single filers with taxable income (including the gain) up to approximately $47,025 and married filing jointly up to approximately $94,050 for 2026. This means if your total taxable income including the capital gain stays below these thresholds, you pay zero federal tax on your long-term gains. This is particularly relevant for retirees with low income, students, or anyone in a low-income year who can strategically realize gains at no tax cost.
How does the Net Investment Income Tax (NIIT) affect my capital gains?
The NIIT adds a 3.8% surtax on net investment income (including capital gains, dividends, interest, rental income) for taxpayers with MAGI exceeding $200,000 (single) or $250,000 (married filing jointly). The 3.8% applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. This effectively raises the top long-term capital gains rate to 23.8% (20% + 3.8%) for high-income taxpayers.
Can capital losses offset my capital gains?
Yes. Capital losses offset capital gains dollar-for-dollar — first against gains of the same type (short-term losses against short-term gains, long-term against long-term), then against the opposite type. If your net losses exceed your gains, you can deduct up to $3,000 of net capital losses against ordinary income per year ($1,500 if married filing separately). Remaining losses are carried forward indefinitely to future tax years.

Get an Accurate Tax Assessment

Online calculators provide estimates. For precise results, consult with our tax professionals.

Book Consultation

Ready to Get Started?

Free 15-minute call with a licensed Enrolled Agent who specializes in your exact situation. No obligation.

Need immediate assistance? Call us at +1 (409) 916-8209