Capital Gains Tax Calculator

Free capital gains tax calculator — estimate federal tax on investment gains using short-term and long-term rates, NIIT surcharge, and optional state tax.

About the Capital Gains Tax Calculator

When you sell an investment for a profit, the IRS taxes the gain. The rate depends on how long you held the asset: short-term gains (held one year or less) are taxed at ordinary income rates, while long-term gains (held over one year) enjoy preferential rates of 0%, 15%, or 20% depending on taxable income. High earners may also owe the 3.8% Net Investment Income Tax (NIIT).

Our Capital Gains Tax Calculator estimates your federal tax liability on a realized gain. Enter your purchase price, sale price, holding period, and income bracket to see the tax owed, net proceeds, and effective after-tax return. An optional state tax rate provides a more complete picture. Short-term gains on assets held less than one year are taxed at your ordinary income rate, which can be as high as 37%. Long-term gains receive preferential rates of 0%, 15%, or 20% depending on your income bracket. This calculator models both scenarios so you can estimate your post-tax proceeds.

Why Use This Capital Gains Tax Calculator?

Tax planning is essential for maximizing after-tax returns. Knowing your estimated tax bill before selling helps you decide whether to hold an asset longer to qualify for long-term rates, harvest losses to offset gains, or time a sale in a lower-income year. This calculator turns tax-code complexity into a simple dollar amount so you can make informed sell decisions.

How to Use This Calculator

  1. Enter the total cost basis (purchase price including commissions).
  2. Enter the total sale proceeds (sale price minus commissions).
  3. Select short-term (1 year or less) or long-term (over 1 year) holding period.
  4. Select your federal income tax bracket for short-term gains or the long-term rate tier.
  5. Optionally check NIIT if your income exceeds $200,000 single / $250,000 married filing jointly.
  6. Optionally enter your state capital gains tax rate.
  7. Review the gain, federal tax, state tax, total tax, and net after-tax proceeds.

Formula

Capital Gain = Sale Proceeds - Cost Basis. Federal Tax = Gain x Federal Rate. NIIT = Gain x 3.8% (if applicable). State Tax = Gain x State Rate. Total Tax = Federal + NIIT + State. Net Proceeds = Sale Proceeds - Total Tax.

Example Calculation

Result: Tax: $1,904 / Net Proceeds: $16,096

You bought stock for $10,000 and sold for $18,000, realizing an $8,000 long-term gain. At 15% federal rate, federal tax is $1,200. Adding 3.8% NIIT ($304) and 5% state tax ($400) brings total tax to $1,904. Your net after-tax proceeds are $16,096, an after-tax return of 60.96% on the original $10,000.

Tips & Best Practices

Federal Capital Gains Tax Brackets

For 2024, single filers pay 0% on long-term gains up to about $47,025 of taxable income, 15% up to $518,900, and 20% above that. Married-filing-jointly thresholds are approximately $94,050 and $583,750. Short-term gains are folded into ordinary income and taxed at your marginal rate, which can be as high as 37%.

Tax-Loss Harvesting Strategy

Tax-loss harvesting involves selling losing investments to realize capital losses that offset gains. Excess losses up to $3,000 per year can offset ordinary income, with any remaining carried forward indefinitely. This strategy effectively converts taxable gains into tax-free gains, improving after-tax returns by 0.5-1.0% annually for taxable portfolios.

Planning Around the Calendar

The one-year dividing line between short-term and long-term gains is strict. Selling one day early can cost thousands in extra taxes. If you are near the one-year mark, consider waiting. Similarly, if you expect a lower income next year (retirement, sabbatical, career change), deferring the sale to January may place you in a lower bracket, reducing both federal and state tax bills.

Frequently Asked Questions

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

Short-term gains are profits on assets held one year or less and are taxed at your ordinary income rate (10-37%). Long-term gains apply to assets held over one year and are taxed at 0%, 15%, or 20% depending on your income. The preferential long-term rates can save you thousands on the same gain amount.

What is the Net Investment Income Tax (NIIT)?

The NIIT is a 3.8% surtax on net investment income for individuals with MAGI above $200,000 (single) or $250,000 (married filing jointly). It applies to interest, dividends, capital gains, rental income, and royalties. It is in addition to the regular capital gains tax, effectively raising the top long-term rate to 23.8%.

How do I reduce my capital gains tax?

Hold assets over one year for lower rates, harvest losses to offset gains, donate appreciated assets to charity for a double benefit (no gain + deduction), use tax-advantaged accounts (IRA, 401k) where gains grow tax-deferred, and consider Qualified Opportunity Zone investments for gain deferral and exclusion. Combining several of these strategies in a single tax year can significantly reduce your overall capital gains liability.

Are capital gains taxed at the state level?

Most states tax capital gains as ordinary income. Seven states — Alaska, Florida, Nevada, South Dakota, Texas, Washington, and Wyoming — have no income tax. A few states offer preferential rates for long-term gains or exclude a portion. Always check current state rules, as they change frequently.

Does this calculator handle wash sale rules?

This calculator estimates tax on a realized gain and does not track wash sale adjustments. If you repurchase a substantially identical security within 30 days before or after a loss sale, the loss is disallowed and added to the replacement security cost basis. Use the Cost Basis Calculator for wash-sale-aware tracking.

Are inherited investments taxed differently?

Yes. Inherited assets receive a stepped-up cost basis to the fair market value at the date of death. This eliminates capital gains tax on all appreciation during the decedent's lifetime. Any gain realized after inheritance is measured from the stepped-up basis, which can dramatically reduce the tax owed.

Related Pages