Capital Gains Tax Calculator

Calculate investment taxes • 2026 rates

Capital Gains Tax Formula:

Show the calculator

Capital Gains Tax = (Capital Gain × Tax Rate)

Capital Gain = Sale Price - Cost Basis

Holding Period: Short-term (≤1 year) vs Long-term (>1 year)

Where:

  • Cost Basis: Original purchase price plus fees
  • Short-term: Taxed as ordinary income (10%-37%)
  • Long-term: Preferential rates (0%, 15%, 20%)
  • Holding Period: Time between purchase and sale

These formulas calculate the tax liability on investment profits. Long-term capital gains receive preferential tax treatment to encourage long-term investing. The holding period determines the applicable tax rate.

Example: Sold stock for $15,000 purchased for $10,000 held for 2 years:

Capital Gain = $15,000 - $10,000 = $5,000

Since held >1 year, long-term rate applies. If in 15% bracket: Tax = $5,000 × 0.15 = $750

The tax liability would be $750 on the $5,000 gain.

Transaction Details

Advanced Options

Tax Analysis

$5,000
Capital Gain
2 Years
Holding Period
15%
Tax Rate
$750
Total Tax
Short-term Rate
22%
Long-term Rate
15%
Tax Saved
$350
Efficiency
30.4%

Holding Period Analysis

Days Held
730
Months Held
24
Classification
Long-term
Rate Applied
15%

Tax Bracket Analysis

Short-term Tax $1,100
Long-term Tax $750
Tax Saved $350
Marginal Rate 22%

Tax Savings Strategies

Hold Until Long-term +$350
Offset with Losses -$0
Tax-Loss Harvesting -$0
Total Potential Savings $350

Tax Optimization

Alternative Minimum $0
Net Investment Income $0
State Tax $75
Total Effective Rate 16.5%

Comprehensive Capital Gains Tax Guide

What is Capital Gains Tax?

Capital gains tax is a tax on the profit from selling capital assets such as stocks, bonds, real estate, or collectibles. It's calculated as the difference between the purchase price (cost basis) and the selling price. The tax rate depends on how long the asset was held before selling.

Capital Gains Tax Formula

The standard capital gains tax calculation uses the following formulas:

Capital Gain = Sale Price - Cost Basis
Capital Gains Tax = Capital Gain × Applicable Tax Rate

Where:

  • Cost Basis: Original purchase price plus fees and improvements
  • Holding Period: Time between purchase and sale
  • Short-term: ≤1 year (taxed as ordinary income)
  • Long-term: >1 year (preferential tax rates)

Tax Rates by Holding Period
1
Short-term Gains: ≤1 year (taxed at ordinary income rates: 10%-37%)
2
Long-term Gains: >1 year (0%, 15%, or 20% based on income)
3
Net Investment Income Tax: Additional 3.8% for high earners
4
State Taxes: Varies by state (0%-13.3%)
Tax Brackets (2026)

Long-term capital gains tax brackets for 2026:

  • 0% Bracket: Up to $44,625 (single), $89,250 (joint)
  • 15% Bracket: $44,626-$492,300 (single), $89,251-$553,850 (joint)
  • 20% Bracket: Over $492,300 (single), over $553,850 (joint)
Tax Planning Strategies
  • Hold for Long-term: Wait until >1 year for lower rates
  • Tax-Loss Harvesting: Offset gains with losses
  • Charitable Donations: Donate appreciated assets to avoid tax
  • Installment Sales: Spread gains over multiple years
  • Opportunity Zones: Temporary tax deferral

Capital Gains Fundamentals

What is Capital Gains Tax?

Tax on profit from selling capital assets.

Calculation Method

Gain = Sale Price - Cost Basis | Tax = Gain × Rate

Where gain = profit, cost basis = original price + fees, rate = applicable tax rate.

Key Rules:
  • Short-term: ≤1 year, taxed as ordinary income
  • Long-term: >1 year, preferential rates
  • Higher rates for higher incomes

Tax Planning

Holding Period Importance

Time held determines tax rate classification.

Optimize Tax Liability
  1. Hold assets >1 year for lower rates
  2. Harvest losses to offset gains
  3. Donate appreciated assets
  4. Consider installment sales
Considerations:
  • Timing sales can significantly impact tax
  • Losses can offset gains up to $3,000 annually
  • Additional NIIT applies to high earners
  • State taxes vary significantly

Capital Gains Tax Learning Quiz

Question 1: Multiple Choice - Tax Rates

What is the maximum federal long-term capital gains tax rate for high-income earners in 2026?

Solution:

The answer is B) 20%. For high-income earners in 2026, the maximum federal long-term capital gains tax rate is 20%. This applies to single filers with income over $492,300 and joint filers with income over $553,850. Additionally, high earners may face an additional 3.8% Net Investment Income Tax.

Pedagogical Explanation:

Understanding the three-tier long-term capital gains structure is crucial for tax planning: 0%, 15%, and 20%. The 20% rate applies to the highest earners and represents the maximum federal rate. This preferential treatment compared to ordinary income rates incentivizes long-term investment. The additional 3.8% NIIT for high earners brings the total maximum to 23.8%.

Key Definitions:

Long-term Gains: Assets held >1 year

High Earners: Above threshold income levels

Preferential Rates: Lower than ordinary income rates

Important Rules:

• 0% rate for lowest earners

• 15% rate for middle earners

• 20% rate for highest earners

Tips & Tricks:

• Remember: 0%, 15%, 20% brackets

• Income thresholds change annually

• Consider NIIT for total tax burden

Common Mistakes:

• Confusing with ordinary income tax rates

• Forgetting about the 3.8% NIIT

• Not knowing income thresholds

Question 2: Capital Gains Calculation

If you sell stock for $25,000 that you bought for $15,000, what is your capital gain? Show your work.

Solution:

Step 1: Apply the capital gains formula

Capital Gain = Sale Price - Cost Basis

Step 2: Substitute the values

Capital Gain = $25,000 - $15,000

Step 3: Calculate

Capital Gain = $10,000

Therefore, your capital gain is $10,000.

Pedagogical Explanation:

This fundamental calculation is the starting point for all capital gains tax computations. The cost basis represents your original investment plus any associated fees or improvements. The sale price is the amount you received from the sale. The difference is your taxable gain. Note that this is just the gain amount - the actual tax depends on holding period and tax bracket.

Key Definitions:

Capital Gain: Profit from asset sale

Cost Basis: Original purchase price

Sale Price: Amount received from sale

Important Rules:

• Gain = Sale Price - Cost Basis

• Include all related fees in cost basis

• Holding period affects tax rate

Tips & Tricks:

• Gain = Sale Price - Cost Basis

• Keep detailed purchase records

• Include transaction fees in basis

Common Mistakes:

• Forgetting to include fees in cost basis

• Calculating tax instead of gain

• Not considering holding period

Question 3: Word Problem - Holding Period Impact

You bought shares for $8,000 on March 15, 2023, and sold them for $12,000 on March 14, 2024. What tax rate applies, and how much tax would you owe if you're in the 22% ordinary income bracket?

Solution:

Step 1: Calculate holding period

From March 15, 2023 to March 14, 2024 = 364 days

Since 364 days < 365 days, this is a short-term gain

Step 2: Calculate capital gain

Capital Gain = $12,000 - $8,000 = $4,000

Step 3: Determine tax rate

Short-term gains are taxed as ordinary income = 22%

Step 4: Calculate tax owed

Tax = $4,000 × 0.22 = $880

Therefore, short-term rate of 22% applies, and you owe $880 in tax.

Pedagogical Explanation:

This example demonstrates the critical importance of the 1-year holding period. Waiting just one day longer (until March 15, 2024) would have qualified for the 15% long-term rate, saving $280 in taxes ($880 - $600). The difference between short-term (22%) and long-term (15%) rates can be substantial, making timing an important consideration in investment decisions.

Key Definitions:

Short-term: Held ≤1 year

Long-term: Held >1 year

Holding Period: Time between purchase and sale

Important Rules:

• ≤1 year = Short-term (ordinary rates)

• >1 year = Long-term (preferential rates)

• Even one day can change tax rate

Tips & Tricks:

• Watch the 1-year anniversary

• Calculate tax savings before selling

• Consider waiting for long-term status

Common Mistakes:

• Miscounting days in holding period

• Thinking 12 months = long-term

• Not considering exact date impact

Question 4: Application-Based Problem - Tax-Loss Harvesting

You have a $5,000 capital gain from selling stock and a $3,000 capital loss from another investment. How does the loss affect your tax liability if the gain would normally incur $750 in tax?

Solution:

Step 1: Apply capital loss to capital gain

Net Capital Gain = $5,000 - $3,000 = $2,000

Step 2: Calculate new tax liability

New Tax = $2,000 × (original rate)

If original tax on $5,000 was $750, the rate was 15%

New Tax = $2,000 × 0.15 = $300

Step 3: Calculate tax savings

Tax Savings = $750 - $300 = $450

Therefore, the loss reduces your tax by $450, leaving $300 to pay.

Pedagogical Explanation:

This demonstrates tax-loss harvesting, a valuable strategy where investors sell losing positions to offset gains. The $3,000 loss completely offsets part of the $5,000 gain, reducing the taxable amount to $2,000. If losses exceed gains, up to $3,000 of ordinary income can be offset annually, with excess losses carried forward to future years.

Key Definitions:

Tax-Loss Harvesting: Using losses to offset gains

Net Capital Gain: Gains minus losses

Loss Carryforward: Unused losses to future years

Important Rules:

• Losses offset gains dollar-for-dollar

• Up to $3,000 excess loss to income

• Remaining losses carry forward

Tips & Tricks:

• Harvest losses before year-end

• Match losses with gains

• Consider wash sale rules

Common Mistakes:

• Not harvesting available losses

• Forgetting wash sale restrictions

• Not tracking carryforwards

Question 5: Multiple Choice - Net Investment Income Tax

When does the 3.8% Net Investment Income Tax (NIIT) apply?

Solution:

The answer is C) On investment income when AGI exceeds thresholds. The 3.8% NIIT applies to net investment income when modified adjusted gross income (MAGI) exceeds $200,000 for single filers ($250,000 for joint filers). It's not just on capital gains but on all net investment income when income thresholds are met.

Pedagogical Explanation:

The NIIT is an additional tax that affects high earners. It's important to understand that it applies to total net investment income (including capital gains, dividends, interest, etc.) when AGI exceeds the thresholds. This can bring the total effective tax rate on long-term gains up to 23.8% (20% + 3.8%) for the highest earners.

Key Definitions:

NIIT: Net Investment Income Tax

AGI: Adjusted Gross Income

High Earners: Above income thresholds

Important Rules:

• Applies when AGI exceeds thresholds

• Affects all investment income

• Additional 3.8% tax rate

Tips & Tricks:

• Thresholds: $200K single, $250K joint

• Affects total tax planning

• Consider when timing sales

Common Mistakes:

• Thinking it only applies to gains

• Not knowing income thresholds

• Forgetting to include in tax planning

capital-gains-tax-calc

FAQ

Q: What's the difference between short-term and long-term capital gains, and why does it matter?

A: The distinction is based on holding period and has dramatic tax implications:

Short-term Capital Gains:

  • Assets held for 1 year or less
  • Taxed as ordinary income at regular rates (10%-37%)
  • No preferential treatment
  • Example: If you're in the 22% bracket, short-term gains are taxed at 22%

Long-term Capital Gains:

  • Assets held for more than 1 year
  • Taxed at preferential rates (0%, 15%, or 20%)
  • Significantly lower rates than ordinary income
  • Example: Same taxpayer might pay only 15% on long-term gains

Why It Matters: The difference can be enormous. A $10,000 gain taxed at 22% (short-term) costs $2,200 in tax, while the same gain taxed at 15% (long-term) costs only $1,500 - a savings of $700!

Q: Can I use capital losses to reduce my tax bill, and how does that work?

A: Yes, capital losses can significantly reduce your tax liability through several mechanisms:

Offsetting Gains:

  • Capital losses directly offset capital gains dollar-for-dollar
  • Short-term losses first offset short-term gains
  • Long-term losses first offset long-term gains
  • Then excess losses can offset gains of the other type

Offsetting Ordinary Income:

  • Up to $3,000 of excess capital losses can offset ordinary income annually
  • Single filers can deduct up to $3,000 from regular income
  • Joint filers can also deduct up to $3,000

Carrying Forward:

  • Any remaining losses beyond the $3,000 limit carry forward to future years
  • Carryforwards have no expiration date
  • Can be used to offset future gains or income

This strategy, called "tax-loss harvesting," can be very effective for managing tax liability across multiple years.

About

EA Team
This calculator was created
This calculator was created by our Finance & Business Team , may make errors. Consider checking important information. Updated: April 2026.