Capital Gains Tax Calculator 2026

Instantly calculate your capital gains tax on stocks, real estate, crypto, and other investments. Our free calculator uses the latest 2026 IRS tax brackets for both short-term and long-term capital gains rates.

Capital Gains Tax Calculator

Results update automatically

$
$
$

Your Results

Instant calculation

Capital Gain

$5,000.00

Your long-term profit

Tax Owed

$750.00

Net After Tax

$4,250.00

Return %

50.0%

Tax Rate Applied

15.0%

How Calculated

Purchase Price$10,000.00
Sale Price$15,000.00
Gross Gain$5,000.00
Tax Rate15.0%
Tax Amount$750.00
Tips
  • Hold investments for 1+ years to qualify for lower long-term capital gains rates
  • If your income is below $47,025 (single), you pay 0% on long-term gains

What Is Capital Gains Tax?

A capital gains tax is a federal (and often state) tax levied on the profit you earn when you sell a capital asset — such as stocks, mutual funds, real estate, cryptocurrency, bonds, or collectibles — for more than you originally paid. The difference between the sale price and your original purchase price (your cost basis) is called a capital gain. That gain is what the IRS taxes.

For example, if you bought 100 shares of a stock at $50 each and sold them at $120 each, your capital gain is $7,000 ($12,000 − $5,000). You owe tax on that $7,000, not on the full $12,000 sale price.

Capital gains taxes are one of the most impactful taxes for investors, retirees selling property, and anyone who builds wealth outside of a regular paycheck. Understanding how they work — and how to legally minimize them — can save you thousands of dollars every year. Our capital gains tax calculator above makes the math instant.

How Is Capital Gains Tax Calculated?

The IRS calculates capital gains tax in three steps:

  1. Determine your cost basis. This is what you paid for the asset, including brokerage commissions, closing costs (for real estate), or any improvements that add to value.
  2. Subtract the cost basis from the sale price. Proceeds minus basis equals your gross gain (or loss). Also subtract selling costs — agent commissions, transfer taxes, etc.
  3. Apply the correct tax rate. The rate depends on how long you held the asset (short-term vs. long-term) and your total taxable income for the year.

Capital Gains Tax Formula

Capital Gain = Sale Price − Cost Basis − Selling Expenses
Tax Owed = Capital Gain × Applicable Tax Rate

Net capital losses (when you lose money on investments) can offset gains dollar-for-dollar. If losses exceed gains, up to $3,000 per year can be deducted against ordinary income, with any remaining losses carried forward to future years.

Want to see this in action for your situation? Use the free capital gains tax calculator at the top of this page.

Short-Term vs. Long-Term Capital Gains

The single most important factor in calculating capital gains tax is your holding period — how long you owned the asset before selling it.

⚡ Short-Term Capital Gains

  • ✦ Asset held 1 year or less
  • ✦ Taxed as ordinary income
  • ✦ Rate: 10% – 37% depending on your bracket
  • ✦ Same rate as your wages and salary
  • ✦ No preferential treatment from IRS
  • ✦ Day traders and flippers often face this rate

🏆 Long-Term Capital Gains

  • ✦ Asset held more than 1 year
  • ✦ Taxed at preferential rates
  • ✦ Rate: 0%, 15%, or 20%
  • ✦ Significantly lower than ordinary income rates
  • ✦ One of the biggest tax advantages for investors
  • ✦ Can result in $0 tax if income is low enough

The tax difference is dramatic. A single filer in the 32% income bracket who sells a stock after 11 months pays 32% on the gain. If they wait just one more month — past the 12-month mark — that rate drops to 15%. On a $50,000 gain, that's a difference of $8,500 in taxes from a single decision about timing.

Use our long-term capital gains tax calculator and short-term capital gains tax calculator to compare both scenarios side by side.

2026 Capital Gains Tax Rates & Brackets

The IRS adjusts income thresholds annually for inflation. Here are the official 2026 long-term capital gains tax brackets:

2026 Long-Term Capital Gains Tax Rates

RateSingle FilersMarried Filing JointlyHead of Household
0%$0 – $48,350$0 – $96,700$0 – $64,750
15%$48,351 – $533,400$96,701 – $600,050$64,751 – $566,700
20%Over $533,400Over $600,050Over $566,700

Source: IRS Revenue Procedure 2025-32. Thresholds apply to taxable income including the capital gain.

2026 Short-Term Capital Gains Tax Rates (Ordinary Income Brackets)

Short-term gains are taxed at your regular income tax rate. For 2026, the federal income tax brackets for a single filer are:

Tax RateSingleMarried Joint
10%Up to $11,925Up to $23,850
12%$11,926 – $48,475$23,851 – $96,950
22%$48,476 – $103,350$96,951 – $206,700
24%$103,351 – $197,300$206,701 – $394,600
32%$197,301 – $250,525$394,601 – $501,050
35%$250,526 – $626,350$501,051 – $751,600
37%Over $626,350Over $751,600

Source: IRS Rev. Proc. 2025-32. These brackets determine the short-term capital gains tax rate applied to assets held 1 year or less.

Not sure which bracket you fall into? Our tax bracket calculator and marginal tax rate calculator can help you figure out your exact rate before you calculate capital gains.

Capital Gains Tax Formula & Real-Life Examples

Example 1: Selling Stocks (Long-Term)

Scenario

  • Purchase price: $20,000
  • Sale price: $55,000
  • Holding period: 18 months
  • Filing status: Single
  • Taxable income (before gain): $75,000

Calculation

  • Capital gain: $55,000 − $20,000 = $35,000
  • Taxable income including gain: $110,000
  • Long-term rate (single, $110K): 15%
  • Tax owed: $35,000 × 15% = $5,250

Example 2: Selling Stocks (Short-Term)

Same Scenario — Sold After 8 Months

  • Capital gain: $35,000 (same)
  • Regular income: $75,000
  • Ordinary income bracket at $110K: 22%
  • Short-term tax owed: $35,000 × 22% = $7,700

💡 Waiting 10 more months saved $2,450 in this example — purely by qualifying for long-term rates.

Example 3: Selling a Home (Primary Residence Exclusion)

Scenario

  • Purchase price: $250,000
  • Sale price: $600,000
  • Gross gain: $350,000
  • Filing status: Married filing jointly
  • Lived in home: 3 of last 5 years

Calculation

  • Section 121 exclusion (MFJ): $500,000
  • Taxable gain: $350,000 − $500,000 = $0
  • Tax owed: $0
  • Full gain excluded!

For more complex home-sale scenarios, check our federal income tax calculator to model your total tax picture after a large gain.

How to Calculate Capital Gains Tax on Real Estate

Real estate capital gains tax is one of the most commonly searched topics — and for good reason. Home values have surged in many U.S. markets, meaning sellers are sitting on large gains. Here's everything you need to know.

Primary Residence: The Section 121 Exclusion

If you sell your primary home, the IRS allows you to exclude a significant portion of your gain from tax under IRC Section 121:

  • Single filers: Up to $250,000 of gain excluded
  • Married filing jointly: Up to $500,000 of gain excluded
  • You must have owned and lived in the home for at least 2 of the last 5 years
  • The exclusion can only be used once every 2 years

Any gain above the exclusion limit is taxable at long-term rates (assuming you owned the home for over a year).

Investment Property & Rental Property

Investment properties — rentals, vacation homes, land — do not qualify for the Section 121 exclusion. Your capital gains on these properties are taxed at standard long-term or short-term rates based on holding period.

There's an important wrinkle: depreciation recapture. If you've been depreciating a rental property (which the IRS actually requires), the portion of your gain attributable to past depreciation deductions is taxed at a special 25% rate — not the standard 0%/15%/20% capital gains rates.

How to Calculate Capital Gains Tax on Sale of Property

Step-by-Step for Rental Property Sale

  1. Start with your adjusted cost basis: purchase price + improvements − accumulated depreciation
  2. Subtract the adjusted basis from the net sale proceeds (sale price minus selling costs)
  3. Identify the depreciation recapture portion — taxed at max 25%
  4. The remaining gain is taxed at long-term capital gains rates (0%, 15%, or 20%)
  5. Check if NIIT applies (3.8% surtax if income exceeds thresholds)

The 1031 Exchange: Defer Capital Gains Tax on Real Estate

Under IRC Section 1031, you can defer capital gains tax by reinvesting the proceeds from selling one investment property into a like-kind replacement property. Key rules:

  • You must identify the replacement property within 45 days of sale
  • The exchange must close within 180 days of the sale
  • The new property must be of equal or greater value
  • Tax is deferred, not eliminated — it carries over to the new property
  • 1031 exchanges only apply to investment/business properties, not primary homes

💡 Farmland Capital Gains

How to calculate capital gains tax on farmland follows the same rules as other investment real estate — holding period determines short vs. long-term rates. However, farmland may qualify for 1031 exchanges, and special installment sale elections can spread the tax liability over several years.

Capital Gains Tax on Stocks, Mutual Funds & Crypto

How to Calculate Capital Gains Tax on Stock Sales

For stocks, your cost basis is the price you paid per share, multiplied by the number of shares. When you buy the same stock at different times (different prices), you must choose an accounting method:

  • FIFO (First In, First Out): The IRS default. The oldest shares are sold first. May result in higher gains if shares have appreciated significantly.
  • Specific Identification: You choose which specific shares to sell, giving you precise control over gains and losses. Best for tax optimization.
  • Average Cost: Only allowed for mutual fund shares. Averages the cost across all purchases.

Mutual Funds and ETFs: Two Layers of Taxation

With mutual funds and ETFs, you face capital gains taxes at two levels:

  • Fund distributions: When the fund sells holdings internally, it passes capital gain distributions to shareholders — even if you didn't sell your shares. These are reported on your 1099-DIV.
  • When you sell fund shares: Your gain or loss is the difference between your sale price and your cost basis in the fund.

How Cryptocurrency Capital Gains Tax Works

The IRS treats cryptocurrency as property (not currency). This means every time you sell, trade, or spend crypto, it is a taxable event. This includes:

  • Selling Bitcoin, Ethereum, or any other crypto for U.S. dollars
  • Trading one cryptocurrency for another (e.g., Bitcoin → Ethereum)
  • Using crypto to buy goods or services
  • Receiving crypto as payment for work (taxed as ordinary income at receipt)

Short-term vs. long-term rules apply the same way. Hold crypto for more than a year and you qualify for the preferential long-term rates (0%, 15%, or 20%). Sell sooner and it's taxed as ordinary income. For crypto calculations, you can use specific identification (FIFO, LIFO, or HIFO) to choose which coins you're selling — HIFO (Highest In, First Out) typically minimizes your taxable gain.

Our crypto capital gains tax calculator applies the same IRS property rules to help you estimate what you'll owe on digital asset sales.

RSUs and Stock Options

Restricted Stock Units (RSUs) and employee stock options have a two-step tax process. First, when RSUs vest (or options are exercised), the value is taxed as ordinary income. Then, when you sell the shares, any additional appreciation is a capital gain (short or long-term based on how long you held after vesting/exercise).

Net Investment Income Tax (NIIT): The 3.8% Surtax

High-income taxpayers face an additional 3.8% Net Investment Income Tax (NIIT) on top of regular capital gains tax. This surtax was introduced by the Affordable Care Act and applies to investment income for taxpayers above these Modified Adjusted Gross Income (MAGI) thresholds:

Filing StatusMAGI ThresholdMax Effective Rate (LT)
Single$200,00023.8%
Married Filing Jointly$250,00023.8%
Married Filing Separately$125,00023.8%
Head of Household$200,00023.8%

The 3.8% NIIT applies to the lesser of net investment income or the amount MAGI exceeds the threshold. NIIT thresholds are NOT inflation-adjusted.

The NIIT applies to capital gains, dividends, rental income, interest, and passive business income. It does not apply to wages, active business income, Social Security benefits, or distributions from IRAs and 401(k)s.

At the highest bracket, the true maximum federal capital gains rate is 23.8% (20% + 3.8% NIIT) — plus any applicable state tax. Pair this with our federal income tax calculator to see your complete federal tax liability.

State Capital Gains Taxes by State

On top of federal capital gains tax, most states impose their own tax on capital gains. Unlike the federal government, most states do not offer preferential long-term rates — they tax capital gains at the same rate as ordinary income.

Capital Gains Tax by State (2026)

StateCapital Gains Tax RateNotes
Florida, Texas, Nevada, Wyoming, South Dakota, Alaska, Washington (most income)0%No state income tax
CaliforniaUp to 13.3%Taxed as ordinary income; highest in U.S.
New YorkUp to 10.9%Ordinary income rates; NYC adds more
New JerseyUp to 10.75%Ordinary income rates
OregonUp to 9.9%Ordinary income rates
MinnesotaUp to 9.85%Ordinary income rates
Massachusetts5% / 8.5%5% long-term; 8.5% short-term
Washington State7%On long-term gains above $262,000
Ohio, Indiana, Pennsylvania3–4.99%Flat or near-flat rates

Rates may change. Consult a tax professional for your specific state situation.

California has the highest combined capital gains tax burden in the nation. A California resident in the top bracket can pay up to 37.1%combined federal and state on short-term gains (37% federal + 13.3% state = 50.3% combined on short-term gains — though the state isn't applied to federal after-tax income, so effective rates are somewhat lower). This is a major reason high-income Californians often relocate before selling large assets.

10 Proven Strategies to Minimize Capital Gains Tax

The IRS offers legal — and powerful — ways to reduce what you owe on capital gains. Here are the most effective strategies used by investors and tax professionals:

1

Hold Assets for More Than One Year

The simplest and most impactful strategy. Converting a short-term gain (taxed up to 37%) to a long-term gain (taxed at 0–20%) can cut your tax bill in half or more. If you're close to the 12-month mark, it almost always pays to wait.

2

Tax-Loss Harvesting

Sell losing investments to offset gains dollar-for-dollar. If losses exceed gains, up to $3,000 can offset ordinary income per year, with the rest carried forward indefinitely. Be mindful of the wash-sale rule — don't repurchase substantially identical securities within 30 days.

3

Max Out Tax-Advantaged Accounts (IRA, 401k, HSA)

Investments inside a Roth IRA, Traditional IRA, or 401(k) grow without annual capital gains tax. A Roth IRA is especially powerful — qualified withdrawals are 100% tax-free, including all growth. Our retirement calculator can show you the long-term impact.

4

Time Your Sales Around Income

If you expect significantly lower income in an upcoming year (retiring, career gap, large deductions), consider delaying a gain until then. Lower income = lower or zero capital gains tax rate.

5

Use the 0% Rate Strategically

If your taxable income falls below the 15% threshold ($48,350 single in 2026), you pay $0 federal tax on long-term capital gains. Retirees with low income can often realize gains completely tax-free — a strategy called "gain harvesting."

6

Donate Appreciated Assets to Charity

Donating appreciated stocks or property to a qualified charity gives you a deduction for the full fair market value while avoiding capital gains tax entirely. Much more tax-efficient than selling the asset and donating cash.

7

Utilize the Primary Residence Exclusion

The Section 121 exclusion is one of the biggest tax breaks available. Single filers exclude $250,000; married couples exclude $500,000. Keep records of home improvements — they increase your cost basis and reduce taxable gain.

8

1031 Exchange for Investment Properties

Defer all capital gains (and depreciation recapture) by rolling sale proceeds into a like-kind investment property. Properly structured, you can exchange indefinitely, passing assets to heirs who receive a stepped-up basis.

9

Gift Assets to Family in Lower Brackets

Gifts of appreciated stock to family members in the 0% capital gains bracket can allow the gain to be realized tax-free. Annual gift tax exclusion is $18,000 per recipient in 2026. Be careful of the "kiddie tax" rules for children under 19.

10

Qualified Opportunity Zone Investments

Invest capital gains in a Qualified Opportunity Fund within 180 days of sale. This defers the original gain and — if held 10+ years — eliminates all new appreciation in the opportunity zone investment entirely.

📋 Capital Gains Tax Disclaimer

This calculator and content are for educational purposes only and do not constitute tax, legal, or financial advice. Tax laws change frequently. For personalized guidance, consult a licensed CPA, tax attorney, or enrolled agent. Always verify figures with the official IRS website (irs.gov) and current-year IRS publications.

More Free Tax & Financial Calculators

Capital gains tax doesn't exist in isolation — it affects your total tax picture. Use these free tools to get the full view:

Frequently Asked Questions About Capital Gains Tax

Capital gains tax is calculated by subtracting your cost basis (purchase price + buying costs) from your net sale proceeds (sale price minus selling costs). The resulting gain is multiplied by your applicable tax rate: short-term gains (assets held ≤ 1 year) use ordinary income rates (10%–37%); long-term gains (held > 1 year) use preferential rates of 0%, 15%, or 20% based on your taxable income.
For a primary residence, subtract your adjusted cost basis (purchase price + improvements + buying costs) from the net sale proceeds. Apply the Section 121 exclusion ($250,000 single / $500,000 married) if you owned and lived there 2 of the last 5 years. Any remaining gain is taxed at long-term rates. For investment/rental properties, also account for depreciation recapture (taxed at up to 25%) before applying capital gains rates to the remaining gain.
Use this formula: Net Capital Gain = Sale Price − Selling Costs − Adjusted Cost Basis. For investment property, Adjusted Cost Basis = Purchase Price + Improvements − Total Depreciation Taken. Tax = Depreciation Recapture (×25%) + Remaining Gain (×long-term rate of 0%, 15%, or 20%) + NIIT (×3.8% if income exceeds thresholds). Use the calculator above for instant results.
Long-term capital gains tax is calculated at 0%, 15%, or 20% depending on your total taxable income for the year. In 2026, single filers with taxable income under $48,350 pay 0%; those from $48,351 to $533,400 pay 15%; and those above $533,400 pay 20%. These thresholds apply to your total income including the gain itself, so a large gain can push a portion into a higher bracket.
Short-term capital gains (assets held 1 year or less) are taxed at your ordinary income tax rate, which ranges from 10% to 37% in 2026 depending on your total taxable income. There are no preferential rates for short-term gains — they are treated exactly like wages or salary income for tax purposes.
You cannot eliminate capital gains tax entirely, but you can legally reduce or defer it. Key strategies include: (1) holding assets over 1 year for lower rates, (2) using tax-loss harvesting to offset gains, (3) maximizing IRA and 401(k) contributions, (4) using the primary residence exclusion on home sales, (5) donating appreciated assets to charity, (6) doing 1031 exchanges on investment property, and (7) investing in Qualified Opportunity Zones. Consult a tax professional for strategies tailored to your situation.
Yes — reinvesting your proceeds does not defer or eliminate capital gains tax. You owe tax in the tax year you sold the asset, regardless of what you do with the money afterward. The main exceptions are: IRA/401(k) rollovers (which are not sales), 1031 exchanges for investment real estate (defers but doesn't eliminate the tax), and qualified opportunity zone investments (defers the tax for several years).
When you sell a stock for a profit, you owe capital gains tax on the gain (sale price minus your cost basis). If held over 1 year, you pay the long-term rate (0%, 15%, or 20%). If held 1 year or less, you pay your ordinary income rate. If you hold shares purchased at different prices, you can choose FIFO (default), LIFO, or specific identification to determine which shares you're selling — which affects your gain calculation.
The IRS treats crypto as property. Your capital gain = Sale proceeds − Cost basis (what you paid when you acquired the crypto). Short-term rates apply if held ≤ 12 months; long-term rates if held > 12 months. Swapping one crypto for another is a taxable event. You must track every transaction. You can use FIFO, LIFO, or HIFO cost basis methods — HIFO (selling highest-cost coins first) typically minimizes your tax liability.
Yes and no. The standard deduction reduces your ordinary taxable income, which determines your tax bracket. However, for long-term capital gains, the IRS uses a special calculation called the "Qualified Dividends and Capital Gain Tax Worksheet." Your long-term gains are effectively "stacked on top" of your ordinary income after deductions — meaning your regular income (minus deductions) fills the lower brackets first, and the capital gains rate depends on where the gain falls in the rate schedule.
The wash sale rule (IRS Section 1091) disallows a capital loss deduction if you buy "substantially identical" securities within 30 days before or after the sale that generated the loss. The disallowed loss isn't gone — it's added to the cost basis of the replacement securities. The wash sale rule applies across all your accounts, including IRAs. It applies to stocks and funds but currently does NOT apply to cryptocurrency (though this may change with legislation).
In 2026, you pay 0% federal capital gains tax if your total taxable income (including the gain) falls below: $48,350 for single filers, $96,700 for married filing jointly, and $64,750 for heads of household. This is one of the most powerful legal tax strategies for early retirees and lower-income investors — known as "gain harvesting." Note: State capital gains taxes may still apply even when the federal rate is 0%.

About This Calculator & Content

This capital gains tax calculator and accompanying guide are maintained by the editorial team at USASalaryTools.com — a trusted resource for U.S. salary, tax, and financial calculation tools. Our tax data is sourced directly from official IRS publications and updated annually following each new Revenue Procedure release. All calculator figures reflect the 2026 tax year using IRS inflation adjustment guidance. For additional reference, see the IRS Topic 409 — Capital Gains and Losses and IRS Publication 550 — Investment Income and Expenses.

Last updated: 2026. This content is for informational purposes only and does not constitute legal, tax, or financial advice. Consult a qualified tax professional for advice specific to your situation.