Free capital gains tax calculator. Enter your sale, income, and state to estimate federal, state, and NIIT on short-term and long-term gains.
When you sell an investment for more than you paid, the IRS taxes the profit — your capital gain.
When you sell an investment for more than you paid, the IRS taxes the profit — your capital gain. The rate depends on three factors: how long you held the asset, your total income, and where you live. For 2025, federal long-term capital gains rates are 0%, 15%, or 20%, plus a potential 3.8% Net Investment Income Tax (NIIT) on high earners. Short-term gains (assets held less than one year) are taxed as ordinary income at rates up to 37%.
State taxes add another layer. Nine states — Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming — charge 0% on capital gains. On the other end, California taxes capital gains at up to 13.3%, meaning a $100,000 long-term gain could cost $13,300 in state tax alone before federal tax. Missouri became the first income-taxing state to fully exempt capital gains in 2025 under HB594. The total tax difference between selling in Texas versus California can exceed $15,000 on the same gain.
The holding period is the single biggest lever you control. A $100,000 gain held for 11 months (short-term) could be taxed at 32–37% federal. The same gain held for 13 months (long-term) drops to 15–20% federal. That two-month difference can save $15,000–$20,000 in taxes. This calculator computes your exact federal, state, and NIIT liability based on your specific situation.
If you're selling a home, note that the Section 121 exclusion may shield $250,000 (single) or $500,000 (married) of gain from tax on your primary residence. For investment properties, consult a tax professional about 1031 exchanges. For understanding how your after-tax income affects buying power, see our home affordability calculator.
Understanding how capital gains tax brackets work prevents the most common mistake: assuming your entire gain is taxed at one rate. Federal capital gains tax is progressive — different portions of your gain are taxed at different rates based on your total taxable income.
**Long-term gains (held 12+ months) get preferential rates.** For 2025, single filers pay 0% on taxable income up to $47,025, 15% from $47,025 to $518,900, and 20% above $518,900. Married filing jointly filers get roughly double these thresholds: 0% up to $94,050, 15% up to $583,750, and 20% above. Your capital gain 'stacks' on top of your ordinary income — meaning your salary determines where in the brackets your gain begins.
**Example:** A single filer with $40,000 taxable income sells stock for a $30,000 long-term gain. Total taxable income with gain: $70,000. The first $7,025 of gain ($40,000 to $47,025) falls in the 0% bracket — no federal tax. The remaining $22,975 ($47,025 to $70,000) falls in the 15% bracket — $3,446 in federal tax. Effective federal rate on the gain: 11.5%, not the 15% many would assume.
**Short-term gains (held less than 12 months) get no preferential treatment.** They're taxed as ordinary income through the same seven federal brackets as your salary: 10%, 12%, 22%, 24%, 32%, 35%, and 37%. On a $100,000 short-term gain for someone in the 32% bracket, the federal tax alone is $32,000 — compared to $15,000 for the same gain held long-term. The holding period difference of even one day (364 days vs 366 days) can save tens of thousands.
**The Net Investment Income Tax (NIIT) adds 3.8% for high earners.** If your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly), you owe an additional 3.8% on the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. These thresholds have been fixed since 2013 and are not inflation-adjusted — meaning more taxpayers are affected each year as incomes rise. If you're considering selling a home, our rent vs buy calculator can help you weigh the financial trade-offs.
Five factors determine your total capital gains tax liability. Understanding each one helps you plan sale timing and minimize your tax burden.
**1. Holding period — the biggest lever.** The difference between short-term and long-term rates can be 15–20 percentage points. If you bought stock on January 15, 2025, selling on January 14, 2026 is short-term (taxed at up to 37%). Selling on January 16, 2026 is long-term (taxed at up to 20%). For a $200,000 gain in the 35% bracket, that two-day difference saves $30,000 in federal tax alone.
**2. Your ordinary income.** Because capital gains stack on top of ordinary income, a higher salary pushes your gains into higher brackets. Someone earning $40,000 might pay 0% federal on their first $7,000 of long-term gains. Someone earning $200,000 pays 15% from the first dollar. This is why timing large gains in lower-income years (sabbatical, career transition, early retirement) can save substantially. See our home affordability calculator to understand how income affects other financial decisions.
**3. Filing status.** Married filing jointly filers get roughly double the bracket thresholds of single filers. A married couple can realize up to $94,050 in long-term gains at the 0% rate — $47,025 more than a single filer. Head of household filers fall in between at $63,000. Filing status also affects the NIIT threshold: $250,000 for married vs $200,000 for single.
**4. State of residence.** Nine states charge zero capital gains tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington (with a 7% excise tax on financial asset gains over $278,000), and Wyoming. Missouri became the first income-taxing state to fully exempt capital gains in 2025 under HB594. At the other extreme, California charges up to 13.3%, New York 10.9%, and New Jersey 10.75%. Moving from California to Texas before selling appreciated assets can save over $13,000 per $100,000 in gains.
**5. Asset type.** Stocks, bonds, ETFs, mutual funds, cryptocurrency, and real estate all qualify for standard capital gains rates. Collectibles (art, antiques, coins, precious metals) face a maximum 28% long-term rate — higher than the standard 20% cap. Qualified small business stock (Section 1202) may qualify for exclusions of 50–100% of the gain. Primary residence sales can exclude $250,000 (single) or $500,000 (married) under Section 121 if you've lived there at least 2 of the last 5 years.
Legal strategies can significantly reduce your capital gains tax burden. These approaches are widely used by tax professionals and financial advisors.
**Tax-loss harvesting.** Offset capital gains by selling losing investments in the same tax year. A $50,000 gain paired with a $30,000 loss results in only $20,000 of net taxable gain. If losses exceed gains, you can deduct up to $3,000 of net losses against ordinary income annually, carrying unused losses forward indefinitely. Important: the IRS wash sale rule prohibits repurchasing a 'substantially identical' security within 30 days.
**Hold for 12+ months.** The single most impactful strategy. Converting a short-term gain to long-term by waiting can reduce your federal rate from up to 37% to a maximum of 20% (plus NIIT). On a $100,000 gain, this saves $17,000–$22,000 in federal tax. Use our calculator to compare short vs long-term scenarios for your specific situation.
**Harvest gains in low-income years.** If you expect a year with lower income — sabbatical, gap between jobs, early retirement — that's the optimal time to realize gains. A married couple with no other income can realize up to $94,050 in long-term gains at the 0% federal rate. Even partial-year income reduction helps: every dollar less in ordinary income keeps more of your gain in lower brackets.
**Use tax-advantaged accounts.** Gains inside 401(k)s, IRAs, and Roth IRAs are not subject to capital gains tax. Roth IRA gains are tax-free permanently after age 59½ and 5 years. Traditional 401(k)/IRA gains are tax-deferred until withdrawal. Prioritizing high-growth investments inside tax-advantaged accounts and holding tax-efficient investments (index funds, municipal bonds) in taxable accounts reduces annual tax drag.
**Donate appreciated assets to charity.** Donating appreciated stock or property directly to a qualified charity allows you to deduct the full fair market value without paying capital gains tax on the appreciation. On a $50,000 stock position with a $10,000 cost basis, donating instead of selling saves $6,000+ in capital gains tax while still providing a $50,000 charitable deduction (subject to AGI limits).
**1031 exchange for investment real estate.** Investment property (not primary residences) can be exchanged for 'like-kind' property under Section 1031, deferring all capital gains tax. The replacement property must be identified within 45 days and acquired within 180 days. This allows real estate investors to continuously defer gains across multiple properties throughout their lifetime. Before buying replacement property, use our home affordability calculator to determine your budget.
**Installment sales.** Spreading the receipt of sale proceeds across multiple tax years can keep you in lower brackets each year. Instead of recognizing a $500,000 gain in one year (pushing into the 20% + 3.8% NIIT bracket), receiving $100,000 per year over five years may keep each year's gain in the 15% bracket — saving thousands in both federal and NIIT taxes. Learn more about how we source our data from the IRS, Tax Foundation, and state revenue departments.
State-specific note
State capital gains tax rates range from 0% in nine states (Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, Wyoming) to 13.3% in California. Your state tax is calculated using your state's effective top capital gains rate sourced from the Tax Foundation and verified against state Department of Revenue publications. Some states (like North Dakota, South Carolina, Wisconsin) offer partial exclusions on long-term gains that reduce the effective rate below the ordinary income rate.
This calculator applies the IRS progressive rate schedule — sometimes called the 'bracket stacking' or 'DTI-equivalent layering' method — using the 2025 federal capital gains tax brackets as published by the IRS (Rev. Proc. 2024-40, updated by the One Big Beautiful Bill Act). For long-term gains (assets held 12+ months), three brackets apply: 0% up to $47,025 for single filers ($94,050 married), 15% up to $518,900 ($583,750 married), and 20% above those thresholds. Your capital gain 'stacks' on top of your ordinary taxable income — so your income determines where in the brackets your gain falls. The standard deduction ($15,750 single, $31,500 married for 2025) is subtracted from your gross income to determine taxable income before bracket placement. For short-term gains (held less than 12 months), the gain is taxed as ordinary income through seven federal brackets from 10% to 37%.
The calculator also computes the 3.8% Net Investment Income Tax (NIIT) when your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). These NIIT thresholds are fixed — not inflation-adjusted — so more taxpayers are affected each year. State capital gains tax uses each state's effective top rate on investment income, sourced from the Tax Foundation 2025 data. The low-to-high range accounts for potential deductions, investment losses, and local tax variations not captured in the state average rate.
<iframe
id="pc-capital-gains-tax"
src="https://pennycheck.com/embed/money/taxes/capital-gains-tax"
width="100%" height="650" frameborder="0"
style="border:none;overflow:hidden"
title="Capital Gains Tax Calculator — How Much Tax Will You Owe? (2026)">
</iframe>
<script>
window.addEventListener("message",function(e){
if(e.data&&e.data.type==="pennycheck-resize"&&e.data.slug==="capital-gains-tax"){
document.getElementById("pc-capital-gains-tax").style.height=e.data.height+"px";
}
});
</script>Data sources