Capital Gains Tax Calculator
Calculate capital gains tax on stocks, mutual funds, property & crypto โ as per Income Tax Act, 2025.
Pick your asset type โ stocks, property, or crypto. Choose your country, enter your buy and sell details, and we'll instantly show your capital gains, applicable tax rate, and exact tax payable. No sign-up needed, no data stored โ it's just you and the numbers.
My Results
๐ As per Income Tax Act, 2025Fill in the details and click Calculate Tax to see your results here.
Related Calculators
Calculate Tax Before You SellCapital Gains Tax Calculator: Accurate 2026 Results in Minutes
You sold something at a profit stocks, a house, maybe a rental property you’ve held since 2011. Now the IRS wants a piece. The question isn’t whether you’ll owe capital gains tax. It’s how much, and whether you can do anything about it before filing.
A capital gains tax calculator takes the guesswork out of that question. Plug in your numbers purchase price, sale price, holding period, filing status, state and you’ll see your estimated federal and state tax bill in seconds.
This article walks you through exactly how the calculator works, what the 2026 rates are, how California and Texas investors get treated differently, and where the calculator’s honest limits are.
What Is Capital Gains Tax & What Does It Cover?
Capital gains tax is the tax you pay on the profit from selling a capital asset stocks, bonds, mutual funds, real estate, crypto, or business interests for more than you paid for it.
The key word is profit. If you bought 100 shares of a company at $40 each and sold them at $90, your gain is $5,000. That’s what gets taxed not the full $9,000 sale proceeds.
Two things determine how much you pay: how long you held the asset, and your total taxable income for the year.
Hold the asset for more than one year before selling, and the IRS taxes your gain at long-term rates 0%, 15%, or 20% depending on income. Sell within a year, and those profits are taxed as ordinary income, at the same rates as your paycheck โ up to 37% in 2026.
Capital assets subject to this tax include:
- Stocks, ETFs, and mutual funds sold in taxable accounts
- Real estate (investment properties, vacation homes, primary residences above the exclusion limit)
- Cryptocurrency
- Collectibles, art, and antiques (taxed at a maximum 28% rate a separate category)
- Business interests and partnership stakes
One thing worth knowing: gains in 401(k)s, IRAs, and 529s are not taxed when the sale happens inside the account. The tax treatment depends on the account type when you eventually withdraw.
Per IRS Publication 525 and IRS Topic No. 409, capital gains and losses are reported on Schedule D of Form 1040.
How Is Capital Gains Tax Calculated?
The core formula is straightforward:
Capital Gain = Sale Price โ Cost Basis
Tax Owed = Capital Gain ร Applicable RateEvery variable in the formula:
| Variable | What It Means |
|---|---|
| Sale Price | The amount you received from the sale (net of broker commissions) |
| Cost Basis | What you originally paid, plus any improvements or reinvested dividends |
| Capital Gain | The taxable profit (Sale Price minus Cost Basis) |
| Holding Period | Over 1 year = long-term rates; 1 year or less = short-term (ordinary) rates |
| Applicable Rate | Federal: 0%, 15%, or 20% (long-term); up to 37% (short-term). State rates vary. |
One layer most calculators skip: If your Modified Adjusted Gross Income (MAGI) exceeds $200,000 (single) or $250,000 (married filing jointly), the IRS adds a 3.8% Net Investment Income Tax (NIIT) on top of your regular rate. This is separate from regular capital gains rates and doesn’t get inflation-indexed that threshold has been frozen at its 2013 level.
For real estate specifically, there’s also depreciation recapture to consider. Any depreciation claimed on a rental property gets taxed at up to 25% when you sell, not at the standard long-term rate. This catches many real estate investors off guard.
How to Use the Capital Gains Tax Calculator (Step-by-Step)
The Share Incentive Plan Calculator is built for US investors and covers stocks, real estate, and other asset types.
Step 1 โ Enter your cost basis. This is what you paid for the asset originally. For stocks, it’s price-per-share times number of shares. For property, it’s your purchase price plus closing costs plus any capital improvements (a new roof, an addition โ not routine maintenance).
Step 2 โ Enter the sale price. For stocks, this is your proceeds net of broker fees. For property, it’s the sale price minus selling costs like agent commissions and title fees.
Step 3 โ Select your holding period. Did you own this asset for more than 12 months? Yes or No. This single choice determines whether you’re in the long-term or short-term category.
Step 4 โ Enter your total taxable income. The calculator needs this to determine which rate bracket you land in. Include your W-2 income, 1099 income, and other taxable sources not just investment income.
Step 5 โ Select your filing status. Single, Married Filing Jointly, Married Filing Separately, or Head of Household. The income thresholds for each bracket differ by filing status.
Step 6 โ Select your state. California and Texas produce very different results. The calculator applies state rates automatically once you select your state.
Step 7 โ Review your results. You’ll see estimated federal tax, state tax (if applicable), NIIT if your income triggers it, and total estimated tax owed.
Worked Example: California Homeowner & Texas Stock Trader
Example 1 โ California Homeowner
Maria is a senior marketing manager in San Jose, California. She bought her home in 2016 for $620,000. She sells it in 2026 for $1,100,000. Her individual taxable income (excluding the home gain) is $180,000.
Gross gain: $1,100,000 โ $620,000 = $480,000
Section 121 exclusion: Maria lived in the home as her primary residence for more than 2 of the last 5 years, so the first $250,000 of gain is tax-free (single filer). Per IRS Section 121.
Taxable gain: $480,000 โ $250,000 = $230,000
Federal long-term rate: Her income of $180,000 + $230,000 = $410,000 total. In 2026, the 15% long-term bracket for single filers runs up to $545,500. She owes 15% federal on the $230,000.
Federal tax: $230,000 ร 15% = $34,500
California state tax: California taxes all capital gains as ordinary income โ no preferential rate for long-term holdings. At her income level, California’s top brackets apply. Estimated CA state tax: approximately $25,000โ$27,000 on the $230,000 gain (effective rate around 11%).
Total estimated tax: Approximately $59,500โ$61,500 on a $480,000 gain.
Estimate only. Actual tax treatment may vary. Consult a licensed CPA or CFP.
Example 2 โ Texas Stock Trader
Devon is a software engineer in Austin, Texas. He bought 500 shares of a technology ETF in March 2024 at $120 per share ($60,000 total). He sells in January 2026 22 months later at $195 per share, for $97,500.
Gain: $97,500 โ $60,000 = $37,500
Holding period: 22 months. Long-term. Federal long-term rates apply.
Devon’s W-2 income: $140,000. Total taxable income including gain: $177,500. In 2026, the 15% long-term bracket for single filers covers income up to $545,500. Devon lands solidly at 15%.
Federal tax: $37,500 ร 15% = $5,625
Texas state tax: $0. Texas has no state income tax, and the state Constitution prohibits it without voter approval. No state capital gains tax applies.
Total estimated tax: $5,625 on a $37,500 gain about 15%.
Estimate only. Actual tax treatment may vary. Consult a licensed CPA or CFP.
Understanding Your Results
When the calculator returns a number, here’s what each line means:
Federal capital gains tax: Your estimated IRS bill, calculated at 0%, 15%, or 20% for long-term gains, or at ordinary income rates for short-term gains.
State capital gains tax: Varies dramatically. California adds up to 13.3%. Texas adds $0. Nine states including Florida, Nevada, and Wyoming โ have no state income tax and therefore no state-level capital gains tax.
Net Investment Income Tax (NIIT): An additional 3.8% federal tax if your MAGI exceeds $200,000 (single) or $250,000 (married). It stacks on top of your base federal rate.
Effective rate: Your total tax as a percentage of the gain. This is usually the most useful number for planning purposes.
Net proceeds: What you actually keep after all estimated taxes.
If your result looks unexpectedly high, two things are usually responsible: state taxes (especially in California) and short-term treatment. Selling one month before crossing the one-year mark can cost significantly more than waiting.
Long-Term vs. Short-Term Capital Gains Tax: Side-by-Side
| Factor | Long-Term Gains | Short-Term Gains |
|---|---|---|
| Holding period required | More than 12 months | 12 months or less |
| Federal tax rates (2026) | 0%, 15%, or 20% | 10% to 37% (ordinary income) |
| NIIT applies? | Yes, if MAGI > $200K/$250K | Yes, if MAGI > $200K/$250K |
| California treatment | Ordinary income (1%โ13.3%) | Ordinary income (1%โ13.3%) |
| Texas treatment | No state tax | No state tax |
| Relevant IRS form | Schedule D + Form 8949 | Schedule D + Form 8949 |
| Key planning lever | Hold past 12 months | Harvest losses to offset gains |
| Best for | Long-term investors | Unavoidable sales (job loss, divorce, illness) |
One thing worth noting: the 0% long-term rate is real and reachable. In 2026, single filers with total taxable income at or below $49,450 pay 0% federal tax on long-term gains. For a married couple filing jointly, that threshold is $98,900. Retirees drawing down investments in a low-income year sometimes qualify for this.
Also check our Long-Term Incentive Calculator if your gains come from equity compensation rather than a standard brokerage account.
Capital Gains Tax on Property Sale & Home Sale
Real estate capital gains tax works differently from stock gains and there are more moving parts.
The Section 121 exclusion. Selling your primary residence? Under IRS Section 121, the first $250,000 of gain is excluded from tax for single filers. Married couples filing jointly get a $500,000 exclusion. To qualify, you must have owned and used the home as your primary residence for at least 2 of the last 5 years before the sale.
This is one of the most valuable tax breaks in the entire tax code. A couple who bought a home in 2010 for $350,000 and sells it in 2026 for $850,000 has a $500,000 gain and owes $0 in federal capital gains tax if they meet the residency test.
Investment properties don’t get this break. A rental property you’ve owned for 8 years gets taxed at regular long-term rates on the full gain. And if you claimed depreciation deductions over the years (which you should have), that depreciation gets “recaptured” at up to 25% when you sell separate from the standard 15% or 20% long-term rate.
The 1031 exchange. If you’re selling one investment property to buy another, a 1031 exchange lets you defer capital gains tax by rolling your proceeds into a like-kind property. There are strict rules about timing (45 days to identify the new property, 180 days to close), but the deferral can be significant on large gains.
Cost basis matters more with real estate. For property, cost basis includes your original purchase price, closing costs at purchase, capital improvements (not repairs), and importantly gets reduced by any depreciation you claimed. Using a cost basis calculator before you sell is worth the time.
Use our ESOP Calculator if your real estate was acquired through a company plan or employee benefit structure.
California Capital Gains Tax: What Makes It Different
Here’s the thing about California capital gains tax: the state doesn’t care how long you held an asset.
Every other state with a capital gains tax and the federal government offers lower rates for long-term investments. California is one of the rare exceptions. The California Franchise Tax Board taxes all capital gains as ordinary income, using the same progressive brackets that apply to wages. A gain held for 30 years gets taxed the same as a gain held for 30 days.
California capital gains tax rates for 2026 (single filers):
| Taxable Income | CA Rate |
|---|---|
| Up to $11,079 | 1% |
| $11,079 โ $26,266 | 2% |
| $26,266 โ $41,452 | 4% |
| $41,452 โ $57,549 | 6% |
| $57,549 โ $72,734 | 8% |
| $72,734 โ $370,376 | 9.3% |
| $370,376 โ $444,444 | 10.3% |
| $444,444 โ $590,742 | 11.3% |
| $590,742 โ $999,999 | 12.3% |
| $1,000,000+ | 13.3% (includes 1% Mental Health Services Tax surcharge) |
(Source: California Franchise Tax Board, updated January 2026)
For a tech employee in San Francisco earning $220,000 in W-2 income who also realizes a $150,000 long-term stock gain, California will tax that entire $370,000 at the applicable brackets reaching 10.3%โ12.3% on the upper portion of the gain.
The combined federal + California rate for a high-income California investor on long-term gains can reach roughly 37%: 20% federal + 3.8% NIIT + 13.3% California. That’s close to the top short-term federal rate alone.
For California-specific planning, use the AMT Calculator Alternative Minimum Tax can also apply to California residents in certain high-gain scenarios.
Texas Capital Gains Tax: What You Actually Owe
Short answer: $0 at the state level.
Texas has no state income tax, and the state Constitution (Texas Proposition 4) explicitly prohibits a personal state income tax without voter approval. That means all capital gains short-term, long-term, real estate, stocks, crypto, business sales โ are taxed at 0% by the state of Texas.
This is a real financial advantage. A Texas investor who realizes a $200,000 long-term gain saves $26,600 compared to a California investor in the same income bracket paying California’s 13.3% top rate.
What Texas residents actually owe on capital gains:
| Gain Type | Texas State Tax | Federal Tax |
|---|---|---|
| Long-term (held 12+ months) | $0 | 0%, 15%, or 20% |
| Short-term (held โค12 months) | $0 | 10%โ37% (ordinary income) |
| Primary home sale | $0 | Usually $0 (Section 121 exclusion) |
| Rental property sale | $0 | 15%โ20% + depreciation recapture up to 25% |
| NIIT (if MAGI > $200K single) | N/A | 3.8% additional federal |
One thing Texas investors still need to track: federal capital gains tax doesn’t disappear. Say a software engineer in Dallas sells appreciated stock options for a $180,000 gain. Texas owes: $0. IRS owes: 15% on the long-term portion, or ordinary income rates on short-term gains.
Also note: if you’ve recently moved from California to Texas and plan to realize a large gain soon, California may still attempt to tax you if they determine you hadn’t fully established Texas residency before the sale. Residency documentation matters.
Federal Capital Gains Tax Rates for 2026
Long-term capital gains rates for 2026 (assets held more than 12 months):
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $49,450 | $49,450 โ $545,500 | Above $545,500 |
| Married Filing Jointly | Up to $98,900 | $98,900 โ $613,700 | Above $613,700 |
| Head of Household | Up to $66,200 | $66,200 โ $579,600 | Above $579,600 |
| Married Filing Separately | Up to $49,450 | $49,450 โ $306,850 | Above $306,850 |
(Source: IRS Revenue Procedure 2024-40, ยง3.03)
Short-term capital gains rates for 2026: Taxed as ordinary income the same 10%, 12%, 22%, 24%, 32%, 35%, or 37% brackets that apply to wages and salaries. No preferential treatment.
Net Investment Income Tax (NIIT): 3.8% additional federal tax applies when MAGI exceeds $200,000 (single) or $250,000 (married filing jointly). This threshold has not been adjusted for inflation since 2013.
Special rates to know:
- Collectibles (art, coins, antiques): capped at 28%
- Unrecaptured Section 1250 gain (real estate depreciation): capped at 25%
- Qualified small business stock (Section 1202): complex rules, potentially 0% for eligible shares
The RSU Tax Calculator covers equity compensation specifically RSUs have their own vesting-event tax treatment separate from standard capital gains rules.
Cost Basis Calculator: Why It Gets It Wrong
Cost basis is what you paid for an asset and it’s the number that determines the size of your taxable gain. Get it wrong, and you either overpay taxes or underreport and face IRS scrutiny.
For stocks, cost basis complications include:
- Dividend reinvestment: Each reinvested dividend creates a new lot with its own cost basis and holding period. If you’ve held a fund for 15 years with automatic reinvestment, you may have dozens of cost basis lots.
- Stock splits: A 4-for-1 split means your per-share basis drops to one-quarter of the original, but total basis stays the same.
- Wash sale rule: If you sell shares at a loss and repurchase the same or substantially identical security within 30 days (before or after), the IRS disallows the loss. The disallowed amount gets added to the cost basis of the repurchased shares.
- Inherited assets: Inherited stocks get a “stepped-up” basis to the fair market value on the date of the original owner’s death not the original purchase price. This can eliminate capital gains entirely on long-held appreciated assets.
For real estate, cost basis includes:
- Original purchase price
- Closing costs paid at acquisition (title fees, recording fees, attorney fees)
- Capital improvements (additions, renovations not repairs)
- But gets reduced by depreciation claimed on rental use
A cost basis calculator helps sort through these adjustments before you run the capital gains calculation. It’s worth doing this work before not after you decide to sell.
Real-World Use Cases
The long-term investor preparing to retire. A couple in Phoenix, Arizona, has held a brokerage account for 22 years. They want to start drawing down $80,000 a year from it. Running the calculation first tells them whether their income level qualifies for the 0% long-term federal rate which, at a modest income in early retirement, it might. That changes the sequencing of which accounts to draw from first.
The rental property seller. A real estate investor in Nashville, Tennessee, sells a rental property bought in 2014 for $195,000. Claimed depreciation over the years: $42,000. Sale price: $410,000. The gain calculation is more involved cost basis is reduced by depreciation, and $42,000 of the gain gets taxed at up to 25% (recapture rate), while the rest is taxed at long-term rates. Using a calculator designed for real estate avoids accidentally applying a flat 15% to the whole gain.
The startup employee with stock options. A product manager in Seattle exercises ISOs worth $300,000. The spread between exercise price and fair market value may trigger AMT. Check the AMT Calculator for this situation capital gains rates alone won’t give the full picture. See also the NCEO’s resources on employee stock ownership for broader context on equity taxation.
The first-time homeowner. Someone who bought a condo in Denver in 2020 for $380,000 sells it in 2026 for $525,000. Gain of $145,000. Under Section 121, assuming they meet the 2-year residency test, the entire $145,000 is excluded โ $0 federal capital gains tax owed. The calculator confirms this quickly.
Common Mistakes & Misconceptions
Forgetting to adjust cost basis. Many investors report the raw purchase price without accounting for broker commissions, reinvested dividends, or capital improvements on real estate. Each of these reduces your taxable gain. Overstating your gain means overpaying taxes.
Confusing California’s treatment with federal. Californians sometimes assume they’ll benefit from the 15% long-term federal rate at the state level too. They won’t. California taxes that same gain as ordinary income โ at rates up to 13.3%. The federal benefit doesn’t carry over to state tax.
Assuming Texas investors pay no tax at all. Texas residents pay no state capital gains tax but federal rates still apply. A short-term gain in Texas still gets taxed at up to 37% by the IRS.
Miscounting the holding period. The IRS measures holding periods to the day. Bought on March 5, 2025? You need to hold until at least March 6, 2026 to qualify for long-term treatment. Selling on March 4, 2026 puts you in short-term territory.
Missing the NIIT. High-income investors who’ve done their calculation at 20% are sometimes surprised when their actual bill is 23.8%. The 3.8% NIIT isn’t optional it’s a separate federal tax that stacks automatically when income exceeds the threshold.
Applying the primary residence exclusion to investment properties. Section 121 applies only to your main home. A vacation cabin you’ve owned for 12 years gets no exclusion the full gain is taxable.
Treating stock options and RSUs like regular capital gains. RSUs are taxed as ordinary income at vesting, not as capital gains. The capital gains calculation only applies to appreciation after the vest date. Using a general capital gains calculator for equity compensation usually produces the wrong number. The RSU Tax Calculator handles this correctly.
When NOT to Rely Only on This Calculator
A tax calculator gives you an estimate. A good one. But it can’t replicate a full tax return. Here’s where to bring in a CPA or CFP:
Multiple asset sales in one year. Capital losses offset gains. If you sold both winners and losers, the net gain โ not each individual gain is what gets taxed. Calculating this netting correctly across short-term and long-term categories requires more than a single-asset calculator.
Depreciation recapture on real estate. The 25% recapture rate on rental property depreciation is a separate tax calculation from the standard long-term rate. The calculator gives a useful estimate, but a CPA should confirm the exact recapture amount.
Equity compensation gains (ISOs, NSOs, RSUs, ESPP). Each type has its own tax treatment. ISOs can trigger AMT. NSO spreads are W-2 income at exercise, not capital gains. RSU income is ordinary at vest. These situations need the right calculator โ and sometimes professional review. Check the Share Incentive Plan Calculator for equity-specific tools.
State-to-state moves. If you moved from California to Texas this year and realized gains in both states, allocating income between states gets complicated. California aggressively audits departing residents who realize large gains shortly after moving.
Alternative Minimum Tax. High-income investors with ISO exercises or large long-term gains may owe AMT on top of regular tax. The AMT Calculator handles this calculation separately.
Estimate only. Actual tax treatment may vary. Consult a licensed CPA or CFP.
Tips to Get the Most Accurate Results
Know your actual cost basis before you start. Pull your brokerage statements. Look for original purchase confirmation, any reinvested dividends, and any stock splits. For real estate, gather your original closing disclosure and receipts for capital improvements.
Use your projected annual income, not last year’s. The rate bracket depends on this year’s taxable income โ including the gain itself. If you’re selling in a year with unusually low income (sabbatical, early retirement, business loss), you may land in a lower bracket than expected.
Run the numbers for both holding periods if you’re close to the one-year mark. If you bought in April 2025 and it’s March 2026, calculate both the short-term and long-term result. The difference tells you the dollar value of waiting another month.
Account for selling costs. For real estate, agent commissions (typically 5%โ6%), title fees, and closing costs reduce your net proceeds and can be deducted from the gain. A $500,000 sale with $30,000 in selling costs has an effective sale price of $470,000 for tax purposes.
Check the NIIT threshold. If your income is anywhere near $200,000 (single) or $250,000 (married), enter your full MAGI not just wages โ to see if the 3.8% surtax applies.
Run separate calculations for each asset. A calculator works best asset by asset. If you’re selling three different stocks and a property, calculate each separately, then net the results. Short-term losses can offset short-term gains, and long-term losses offset long-term gains first.
Frequently Asked Questions
Q: How does the capital gains tax calculator work for someone who is self-employed?
A: Self-employed investors use the calculator the same way as W-2 employees enter your total taxable income from all sources, including net self-employment income after the self-employment deduction. The difference is that self-employment income also triggers FICA taxes (Social Security at 6.2% up to the $176,100 wage base for 2026, plus Medicare at 1.45%). Those don’t apply to capital gains income, but they affect your total income bracket. Run your net self-employment income as your base, then layer the capital gain on top.
Q: Does the calculator handle the Section 121 home sale exclusion automatically?
A: The calculator applies the Section 121 rules when you indicate you’re selling a primary residence and enter the appropriate holding period and residency details. Single filers can exclude up to $250,000 in gain; married couples filing jointly can exclude up to $500,000. You must have owned and used the home as your primary residence for at least 2 of the last 5 years before the sale. If your gain is below the exclusion limit, the calculator will show $0 federal capital gains tax owed on the home sale.
Q: What’s the difference between the capital gains tax rate and the effective tax rate shown in the results?
A: The capital gains tax rate is the bracket rate applied to your gain 0%, 15%, or 20% for long-term gains in 2026. The effective rate is your total estimated tax as a percentage of the full gain, after accounting for any NIIT, state taxes, and the possibility that only part of your gain falls in a particular bracket. A single filer earning $70,000 with a $50,000 long-term gain, for example, doesn’t pay 15% on the entire $50,000 the portion of the gain that fills up to the $49,450 threshold pays 0%, and only the remainder is taxed at 15%. The effective rate reflects this blending.
Q: If I reinvest my capital gains immediately, do I still owe tax?
A: Yes. Reinvesting proceeds doesn’t defer or eliminate the tax. Capital gains tax is owed the year you sell โ regardless of what you do with the money afterward. The one major exception is a 1031 exchange for real estate, which defers (not eliminates) the tax by rolling gains into a like-kind property under specific IRS rules. Qualified Opportunity Zone investments offer another deferral route for investors willing to hold for 5โ10 years. But a standard stock sale where you immediately reinvest in another fund? That’s a taxable event, full stop.
Q: Can capital losses from stocks offset capital gains from a home sale?
A: Yes, with conditions. Capital losses are first netted against gains of the same type short-term losses offset short-term gains first, long-term losses offset long-term gains first. Any excess can cross over. So if you have a $30,000 long-term stock loss and a $90,000 long-term real estate gain, the net taxable long-term gain is $60,000. If losses exceed all gains in a given year, you can deduct up to $3,000 of the excess against ordinary income, with the rest carrying forward indefinitely under IRS Section 1212.