Capital Gains Tax Calculator

Calculate capital gains tax on investments with federal and state rates. Compare short-term vs long-term tax treatment and see your after-tax profit.

5,000.00
Total Gain
After-tax profit
$3,750

Investment details

Enter purchase and sale information.

Tax information

Your filing status and income for tax rates.

Relevant tools

Browse all →

Quick internal links for related tools.

Understanding capital gains tax

Capital gains tax is a tax on the profit when you sell an asset for more than you paid for it. This applies to stocks, bonds, real estate, and other investments. The tax only applies to the gain (the difference between sale and purchase price), not the entire sale amount.

The United States tax system distinguishes between short-term and long-term capital gains. Short-term gains (assets held one year or less) are taxed at ordinary income rates, which can be as high as 37%. Long-term gains (assets held more than one year) receive preferential treatment with rates of 0%, 15%, or 20% depending on your income level.

This distinction makes timing crucial for investment decisions. Holding an asset for just over a year can dramatically reduce your tax burden. For example, a $10,000 gain taxed at 24% (short-term ordinary rate) versus 15% (long-term rate) saves $900 in taxes.

Long-term capital gains tax rates

Long-term capital gains rates are progressive and depend on your taxable income and filing status. For 2024, single filers pay 0% on gains up to $47,525 of taxable income, 15% on gains between $47,526 and $102,550, and 20% on gains above $102,550. Married filing jointly couples have roughly double these thresholds.

These preferential rates were designed to encourage long-term investment. The 0% bracket means many middle-income investors pay no federal tax on long-term gains at all. High-income investors still benefit, as the 20% maximum rate is significantly lower than ordinary income tax rates.

Additional taxes may apply to high-income investors. The 3.8% Net Investment Income Tax (NIIT) applies to individuals with modified adjusted gross income over $200,000 (single) or $250,000 (married filing jointly). This brings the effective rate to 23.8% for affected taxpayers.

State capital gains tax considerations

While federal capital gains rates are the same nationwide, state taxes vary significantly. Most states tax capital gains as ordinary income at their regular tax rates. High-tax states like California (13.3%), New York (10.9%), and Oregon (9.9%) can substantially increase your total tax burden.

Conversely, several states have no income tax, including Florida, Texas, Washington, Nevada, Wyoming, South Dakota, and Tennessee. Investors in these states only pay federal capital gains tax, potentially saving thousands compared to high-tax states.

Some states offer specific capital gains treatment. For example, Colorado has a flat 4.4% rate, while Pennsylvania taxes all income including capital gains at a flat 3.07%. Always check your state's specific rules when planning investment sales.

Tax-loss harvesting strategies

Tax-loss harvesting is selling investments at a loss to offset capital gains. You can deduct up to $3,000 in excess capital losses against ordinary income per year, with additional losses carried forward to future years. This strategy can significantly reduce your tax burden.

The wash sale rule prohibits buying the same or substantially identical security within 30 days before or after selling at a loss. However, you can buy a similar but not identical fund, or wait 31 days to repurchase the same security.

Strategic tax-loss harvesting works best in taxable accounts (not IRAs or 401(k)s). Consider your overall investment strategy rather than tax implications alone—don't let the tax tail wag the investment dog.

Special exemptions and exclusions

The most significant capital gains exclusion is for primary residence sales. Single filers can exclude up to $250,000 of gain ($500,000 for married couples) if they owned and lived in the home for at least two of the five years before selling. This exclusion applies once every two years.

Other special situations include qualified small business stock (Section 1202 exclusion), which can exclude up to 100% of gains on certain small business stock held more than five years. Like-kind exchanges under Section 1031 allow deferring capital gains on real estate exchanges, though this no longer applies to personal property.

Retirement accounts like IRAs and 401(k)s grow tax-deferred, with gains taxed as ordinary income upon withdrawal (or tax-free for Roth accounts). This makes them ideal for high-turnover strategies or investments that would generate short-term gains.

Planning considerations and timing

Strategic timing of investment sales can significantly impact your tax bill. Consider your expected income for the year—if you're in a low-income year, it might be advantageous to realize gains. In high-income years, consider delaying sales if possible.

The timing of gains matters throughout the year. Realizing gains early in the year gives you more time to plan offsetting losses. Year-end planning should consider your expected income and tax situation for the following year as well.

For investors with fluctuating income, such as business owners or commission-based workers, timing gains to align with lower-income years can result in substantial tax savings. Always consider the investment fundamentals—don't let tax considerations drive poor investment decisions.

Frequently Asked Questions

What is capital gains tax?

Capital gains tax is a tax on the profit made from selling an asset that has increased in value. The tax applies to the difference between the sale price and the purchase price, not the entire sale amount.

What's the difference between short-term and long-term capital gains?

Short-term capital gains apply to assets held for one year or less and are taxed at ordinary income rates. Long-term capital gains apply to assets held for more than one year and receive preferential tax rates of 0%, 15%, or 20% depending on your income level.

How are capital gains tax rates determined?

For long-term gains, rates depend on your taxable income and filing status. In 2024, single filers pay 0% up to $47,525, 15% up to $102,550, and 20% above that. Short-term gains are taxed at your ordinary income tax bracket.

Do I have to pay capital gains tax on my primary residence?

Not necessarily. The home sale exclusion allows single filers to exclude up to $250,000 of gain ($500,000 for married couples) if you owned and lived in the home for at least 2 of the 5 years before selling.

How do state taxes affect capital gains?

Most states tax capital gains as ordinary income at your state's regular tax rate. However, some states like Florida, Texas, and Washington have no income tax, while others like California have high rates that significantly impact your after-tax returns.

What is the net investment income tax?

The NIIT is an additional 3.8% tax on investment income including capital gains, interest, and dividends for individuals with modified adjusted gross income over $200,000 (single) or $250,000 (married filing jointly).

Can capital losses offset capital gains?

Yes. Capital losses can offset capital gains dollar for dollar. If your losses exceed your gains, you can deduct up to $3,000 of excess losses against ordinary income per year and carry forward remaining losses to future years.

How does holding period affect tax treatment?

The holding period is crucial. Holding an asset for more than one year transforms it from short-term (taxed as ordinary income, often 22-37%) to long-term (taxed at 0%, 15%, or 20%), potentially saving thousands in taxes.

Privacy and methodology

This calculator runs entirely in your browser with no server processing. It calculates capital gains as the difference between sale and purchase prices, determines holding period for short-term vs long-term treatment, applies appropriate federal rates based on 2024 tax brackets, and adds state tax at your specified rate. Results should be used for planning purposes—consult a tax professional for specific advice.

Tool Vault — Capital Gains Tax Calculator 2026. Fast, private, and mobile-friendly.