Skip to main content
Monday, June 15, 2026·2026 Edition
AboutMethodologyContact
The TakeHomeTax
Home/Calculators/Investment Calculators
Investment Calculators

Capital Gains Tax Calculator

Calculate capital gains tax on stocks, crypto, and real estate sales. See federal, NIIT, and state tax by holding period.

By NumbersLab Editorial·Updated for 2026 tax year·Editorial standards
Stock chart with rising prices — representing capital gains tax calculation on stocks, crypto, and real estate at long-term and short-term rates
Photo by Markus Spiske on Unsplash
Interactive Calculator

All inputs adjust the result in real time. No data leaves your browser.

Tax Year
$
$
salary, wages, etc.
$
Net Proceeds After Tax
$21,70022.0% effective rate on gain
$15,000 capital gain → $3,300 total tax
Capital Gain
$15,000
Short-term
Federal CG Tax
$3,300
At ordinary income rates
NIIT (3.8%)
$0
Below threshold
State CG Tax
$0
No state capital gains tax
Save by Holding 1 More Year
$1,050
Long-term tax would be $2,250 vs $3,300 short-term
Tax Breakdown
Sale Price$25,000
Cost Basis−$10,000
Capital Gain$15,000
Federal CG Tax (short-term)−$3,300
Net Investment Income Tax (3.8%)$0
Texas State Tax$0
Total Tax$3,300
Net Proceeds$21,700
Effective Rate on Gain22.0%

Frequently Asked Questions

How are capital gains taxed federally?

Short-term capital gains (assets held one year or less) are taxed at your ordinary income tax rate, which ranges from 10% to 37% depending on your bracket. Long-term capital gains (assets held more than one year) receive preferential rates of 0%, 15%, or 20% based on your taxable income. The long-term rates are significantly lower for most taxpayers, making holding period one of the most important factors in investment tax planning.

Do all states tax capital gains?

No. Nine states have no income tax and therefore do not tax capital gains: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. The remaining 41 states and Washington D.C. tax capital gains, typically at the same rate as ordinary income. California has the highest state capital gains rate at 13.3%, while states like Arizona (2.5% flat) and North Dakota (1.95%) are among the lowest.

Is crypto taxed differently than stocks?

Crypto and stocks are taxed at the same federal capital gains rates. The key difference is that wash sale rules currently apply to stocks but not to cryptocurrency. This means you can sell crypto at a loss, immediately repurchase it, and still claim the tax loss. With stocks, you must wait 31 days to repurchase a substantially identical security after a loss sale. Every crypto trade, swap, and spending event is a taxable event that must be reported to the IRS.

What is the Net Investment Income Tax?

The Net Investment Income Tax (NIIT) is an additional 3.8% surtax on investment income including capital gains, dividends, interest, and rental income. It applies when your modified adjusted gross income (MAGI) exceeds $200,000 for single filers or $250,000 for married filing jointly. The tax is calculated on the lesser of your net investment income or the amount your MAGI exceeds the threshold. Unlike regular tax brackets, these NIIT thresholds are not indexed for inflation.

Related Tax Calculators

Sponsored
Disclosure
Analyzing a property purchase or sale?
DealCheck imports any listing and runs the full investment analysis — cap rates, cash flow, basis tracking for capital gains, and offer math. Used by 350,000+ investors.
Try DealCheck Free →
2026 long-term capital gains tax brackets for single filers showing 0% up to $48,350, 15% up to $533,400, and 20% above
Figure. Long-term capital gains rates for single filers in 2026. The 0% bracket reaches $48,350 of total taxable income — meaning lower-income years are opportunities for tax-free LTCG harvesting.Source: IRS Revenue Procedure 2025-11, IRC §1(h)
The Background

Capital gains are taxed at two distinct rates depending on how long you held the asset. Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income tax brackets, which range from 10% to 37% for 2026. Long-term capital gains apply to assets held for more than one year (specifically, one year and one day or longer) and receive preferential tax rates of 0%, 15%, or 20% depending on your taxable income. For single filers in 2026, the 0% rate applies to taxable income up to $50,600, the 15% rate applies up to $559,750, and the 20% rate applies above that threshold. Married filing jointly filers get roughly double those bracket thresholds. This difference in rates is the single biggest lever you have for reducing investment taxes.

The Net Investment Income Tax (NIIT) is an additional 3.8% surtax on investment income that applies to high earners. The NIIT thresholds are $200,000 for single filers and $250,000 for married filing jointly. The tax applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds the threshold. This means that if your ordinary income plus capital gains pushes you over the threshold, you could owe an extra 3.8% on some or all of your capital gain. The NIIT applies to both short-term and long-term capital gains, as well as dividends, interest, rental income, and royalties.

State capital gains tax varies dramatically across the country. Nine states have no income tax at all and therefore do not tax capital gains: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. On the other end of the spectrum, California taxes capital gains at the same rate as ordinary income, with a top rate of 13.3%. New York, New Jersey, Oregon, and Hawaii also impose high rates on capital gains. Some states offer preferential treatment for long-term gains or provide exclusions for certain types of investments. Your state of residence can make a difference of tens of thousands of dollars on a large capital gain.

The IRS treats cryptocurrency as property, not currency. This means every trade, swap, or spending of crypto triggers a taxable event. If you trade Bitcoin for Ethereum, that is a sale of Bitcoin and a purchase of Ethereum, and you owe capital gains tax on any appreciation in the Bitcoin. DeFi transactions such as providing liquidity, yield farming rewards, and token swaps each create taxable events. NFT sales are taxed as capital gains, and airdrops and hard fork tokens are generally treated as ordinary income at the time of receipt. Accurate cost basis tracking across wallets and exchanges is essential for crypto tax compliance.

Wash sale rules currently apply to stocks, bonds, and other securities but do not apply to cryptocurrency as of 2026. Under wash sale rules, if you sell a stock at a loss and repurchase the same or substantially identical security within 30 days before or after the sale, you cannot claim the tax loss. However, because the IRS classifies crypto as property rather than a security, you can sell crypto at a loss and immediately repurchase the same token to harvest the tax loss. This provides a significant tax planning advantage for crypto investors. Be aware that Congress has considered extending wash sale rules to crypto, and this loophole may close in future legislation.

Real estate capital gains have several special provisions. If you sell your primary residence and have lived in it for at least two of the last five years, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) from taxation under Section 121. For investment properties, Section 1031 like-kind exchanges allow you to defer capital gains indefinitely by reinvesting proceeds into another qualifying property within specific time limits. However, depreciation recapture applies to rental property at a flat 25% rate on the portion of gain attributable to depreciation deductions taken during ownership, regardless of your income level or holding period.

Several strategies can help minimize your capital gains tax burden. Tax-loss harvesting involves selling losing investments to offset gains, reducing your net taxable gain. Managing your holding period to ensure assets qualify for long-term treatment can cut your federal rate from as high as 37% to a maximum of 20%. Investing in Qualified Opportunity Zones can defer and partially reduce capital gains taxes. Donating appreciated assets to charity lets you deduct the full market value without paying capital gains tax on the appreciation. Timing sales across tax years can keep you in lower brackets, and using tax-advantaged accounts like Roth IRAs for investments with high growth potential eliminates capital gains entirely on those assets.

Frequently Asked
How are capital gains taxed?+
Short-term capital gains (assets held 1 year or less) are taxed at your ordinary income rate — federal brackets 10-37% plus state. Long-term capital gains (held more than 1 year) are taxed at preferential rates: 0% for taxable income up to $48,350 single / $96,700 married in 2026; 15% for income up to $533,400 single / $600,050 married; 20% above those thresholds. High earners also face the 3.8% Net Investment Income Tax on gains over $200,000 MAGI single / $250,000 married, bringing the top federal LTCG rate to 23.8%.
What is the difference between short-term and long-term capital gains?+
Holding period is measured day-by-day from the day after purchase to the day of sale. One year and a day = long-term. One year exactly = still short-term. Short-term gains are taxed at ordinary rates (potentially 37% federal); long-term gains get the preferential brackets (0/15/20%). For a high earner in the 35% bracket, holding a winning position one extra day to convert short-term to long-term can save 20 percentage points of federal tax — a $100,000 gain saves $20,000. This is one of the few personal finance levers where calendar awareness alone generates substantial value.
How do I avoid capital gains tax?+
Legitimate strategies: (1) Hold for the long-term period to qualify for 0/15/20% rates instead of ordinary income rates; (2) Tax-loss harvest — sell losing positions to offset gains; (3) Use tax-advantaged accounts (IRA, 401(k), HSA) for assets you trade frequently; (4) Donate appreciated assets to charity instead of cash — no gain recognized, full FMV deduction; (5) For primary residence: §121 exclusion of $250,000 single / $500,000 married if you lived there 2 of the last 5 years; (6) Step-up in basis at death — heirs inherit assets at current FMV with no gain on the appreciation during your lifetime; (7) 1031 exchanges for investment real estate.
What is tax-loss harvesting?+
Tax-loss harvesting is selling investments at a loss to offset capital gains, with up to $3,000 of net losses also offsetting ordinary income annually (unused losses carry forward indefinitely). The wash sale rule prevents you from buying back 'substantially identical' securities within 30 days before or after the sale — so you typically swap into a similar but not identical asset (e.g., sell VOO, buy IVV, both S&P 500 ETFs from different providers). Tax-loss harvesting can save high earners $1,000-$5,000+/year and the value compounds if reinvested. Be aware: harvesting reduces your basis, so you're deferring tax, not eliminating it.
Do I pay capital gains tax on my house?+
Maybe. IRC §121 excludes up to $250,000 of gain on the sale of your primary residence ($500,000 married filing jointly) if you owned and lived in it as your primary home for at least 2 of the 5 years preceding the sale. Gains above the exclusion are taxed at long-term capital gains rates (0/15/20%) plus the 3.8% NIIT if your MAGI is high enough. Investment properties don't qualify for §121 — those use 1031 exchanges to defer gain or pay long-term capital gains on sale. Depreciation recapture on rentals is taxed at up to 25% (separate from the 15-20% LTCG rate).
More in Investment Calculators
Browse all investment calculators
The Full Index
PaycheckFreelance TaxOvertime (OBBBA)Quarterly EstimatesBonus TaxW-4 WithholdingTax RefundStock OptionsRSU TaxSelf-EmploymentSide IncomeRetirementSalary → HourlyHourly → SalaryMarriage TaxRelocationCost of LivingEmployer Cost1099 vs W2Social SecurityPaycheck PlannerSalary NegotiationRetirement PlannerBracket VisualizerSide HustleTotal CompAMT TriggerCharitable GivingWithdrawal SequencerTrue Marginal RateTax Cliff MapRMD ForecasterSS Claiming AgeLump Sum vs AnnuityInherited IRARMDInflation SalaryRoth vs Traditional 401kHSA Triple-Tax401(k)
Was this calculator helpful?
The Take-Home Tax Guide
Weekly tips on reducing your tax burden, state tax changes, and salary negotiation strategies. Free.