Capital Gains Tax Calculator

How much tax will you owe on your investment gains?

Calculate the capital gains tax you'll owe on investment profits from stocks, real estate, or other assets. This calculator determines your tax rate based on income level and holding period, then shows your net gain after taxes.

Updated June 2026 · How this works

Example calculation — edit any field to use your own numbers

Worth knowing
How It Works
The formula, explained simply

Most investors focus on their gains but forget about Uncle Sam's cut. Capital gains tax works like a partnership where the government claims a percentage of your investment profits based on two key factors: how long you held the asset and your total income level.

The tax system creates a dramatic cliff at exactly 365 days. Sell Apple stock after 364 days of ownership, and your $10,000 profit gets taxed at rates up to 37%. Wait one more day, and that same profit faces a maximum 20% rate. This single day can save thousands in taxes on large gains.

Your regular income determines which tax bracket applies to your gains. A teacher earning $50,000 annually pays 0% on long-term gains, while a surgeon earning $500,000 pays 20% on identical profits. The government essentially charges more successful earners higher rates to share in their investment success.

When To Use This
Right tool, right situation

Use this calculator when deciding whether to sell appreciated assets before year-end or wait until after January 1st. The tax savings from crossing the one-year threshold often outweigh short-term market risks, especially for large positions in stable companies.

This tool helps during retirement planning when you're managing taxable account withdrawals. Retirees can often time asset sales during low-income years to take advantage of the 0% long-term capital gains rate, effectively harvesting gains tax-free.

Don't rely on this calculator for complex situations like installment sales, like-kind exchanges, or assets with depreciation recapture. These specialized transactions have different rules that override standard capital gains treatment.

Common Mistakes
Why results sometimes look wrong

The biggest mistake is selling winners too early to 'lock in profits' without considering the tax calendar. Day traders and momentum investors often generate massive short-term gains taxed at ordinary rates up to 37%, while buy-and-hold investors on identical stocks pay maximum 20% rates.

Another expensive error is forgetting about cost basis adjustments. Real estate investors miss deductions for improvements, mutual fund holders ignore reinvested dividends that increase their basis, and stock traders forget to account for splits and spin-offs. These oversights inflate your taxable gain artificially.

High earners frequently trigger the net investment income tax without realizing it. This additional 3.8% tax kicks in when investment income plus modified adjusted gross income exceeds $200,000 for singles or $250,000 for couples, making the effective capital gains rate 23.8% instead of 20% for top brackets.

The Math
Worked examples and deeper derivation

The calculation starts with your cost basis — what you actually paid including fees and improvements. Subtract this from your sale proceeds to find your gain. Then the tax system splits into two parallel tracks based on your holding period.

Short-term gains (under one year) get added directly to your ordinary income and taxed at the same rates as your salary. If you're in the 24% tax bracket, your short-term trading profits face that same 24% rate. Long-term gains (over one year) use completely separate rate tables: 0%, 15%, or 20% based on your total income.

The math gets interesting at the boundaries. Someone earning $44,625 pays 0% on long-term gains, but earning $44,626 triggers a 15% rate on all gains above zero. These cliff effects make income timing crucial for tax planning, especially in years with large asset sales.

Tech stock windfall after IPO
Bought 1,000 pre-IPO shares at $15 each, sold 18 months later at $85 per share, annual income $120,000
$10,500 tax on $70,000 gain. The 15% long-term rate saves you $5,900 compared to short-term treatment. Timing the sale after one year cut your tax bill nearly in half.
Real estate investment property
Purchased rental property for $200,000, sold for $275,000 after 3 years, plus $5,000 in improvements, annual income $95,000
$10,500 tax on $70,000 gain after improvements. Long-term capital gains treatment applies to investment property held over one year, making real estate tax-efficient for patient investors.
Cryptocurrency trading mistake
Bought Bitcoin for $25,000, sold 8 months later for $45,000, annual income $75,000
$4,400 tax on $20,000 gain. Short holding period triggers 22% ordinary income tax rate. Waiting 4 more months would have reduced the tax to $3,000 with long-term treatment.
Expert Unlock
The thing most explanations skip

Professional investors know that capital gains rates are just the starting point. The wash sale rule prevents you from claiming losses on securities if you buy substantially identical assets within 30 days. State taxes add another layer — California's 13.3% top rate makes federal long-term treatment less valuable for residents there.

How does holding period affect my capital gains tax?

What counts as long-term vs short-term capital gains?
Assets held for more than one year qualify for long-term capital gains treatment with lower tax rates. Assets sold within one year are taxed as short-term gains at your ordinary income tax rate. The holding period clock starts the day after you purchase and includes the sale date.
Why are long-term capital gains taxed at lower rates?
Congress designed lower long-term rates to encourage investment and economic growth. Long-term investors face market risk over extended periods, and the tax code rewards this patience. The rate difference can be dramatic — a 37% earner pays 20% on long-term gains versus 37% on short-term profits.
Do I owe state capital gains tax too?
Most states tax capital gains as ordinary income at their regular income tax rates. Nine states have no capital gains tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. Check your state's specific rules as they vary significantly from federal treatment.

Need something this doesn't cover?

Suggest a tool — we'll build it →