Civilable
Back to all calculators

Capital Gains Tax Calculator

Estimate your capital gains taxes based on US tax brackets. Currently calculating in US Dollar.

Tax Information
Enter your income and asset details

Your ordinary income (salary, wages, etc.) before capital gains

Estimated Capital Gains Tax

$750

15.0% effective rate on gains

Net Capital Gains

+$5,000

Short-Term (Net)

+$0

Taxed as ordinary income

Long-Term (Net)

+$5,000

Preferential rates

After-Tax Gains

$4,250

Short-Term vs Long-Term
Tax Breakdown
Asset Details
AssetTypeCost BasisProceedsGain/LossHoldingTerm
Stock Salestock$10,000$15,000+$5,000882 daysLong
2024 Capital Gains Tax Rates

Long-Term Capital Gains (Single)

$0 - $47,0250%
$47,025 - $518,90015%
Over $518,90020%

Short-Term Capital Gains

Taxed as ordinary income (10% - 37% based on your tax bracket)

Hold for 1+ year to qualify for long-term rates

Long-term gains are taxed at preferential rates (0%, 15%, or 20%)

Guide

What is a Capital Gains Tax Calculator?

A capital gains tax calculator estimates the federal tax you owe on the profit from selling a capital asset — a stock, ETF, bond, real estate property, cryptocurrency, or collectible — for more than you paid for it. The IRS taxes these profits differently depending on how long you held the asset before selling, your total taxable income, and your filing status.

The most important dividing line is the one-year holding period. Assets sold within 365 days of purchase produce short-term capital gains, taxed at your ordinary income rate (10%–37% in 2024). Assets held for more than one year produce long-term capital gains, taxed at the preferential rates of 0%, 15%, or 20% — a significant difference that can mean tens of thousands of dollars in tax savings on the same gain.

This calculator applies the 2024 U.S. federal tax brackets for both short-term and long-term gains, accounts for the 3.8% Net Investment Income Tax (NIIT) on high earners, applies the $3,000 capital loss deduction limit with carryover tracking, and handles multiple assets simultaneously — making it suitable for modeling an entire year's worth of investment transactions.

Disclaimer: This calculator provides estimates for educational purposes only. Tax law is complex and changes frequently. Consult a qualified tax professional for advice specific to your situation.

Instructions

How to Use This Calculator

1

Set Your Filing Status and Income

Select your IRS filing status (Single, Married Filing Jointly, or Head of Household) and enter your other taxable income — salary, wages, and ordinary income before capital gains. Both determine which long-term rate brackets apply to your gains.

2

Enter Each Asset Sold

For each capital asset you sold, enter the asset name, type, purchase price, sale price, quantity, purchase date, and sale date. The holding period is calculated automatically from your dates to classify the gain as short-term or long-term.

3

Add Multiple Assets

Use the Add Asset button to include every sale from the tax year. The calculator nets short-term gains against short-term losses and long-term gains against long-term losses, applying the correct offsetting rules before calculating tax.

4

Review the Full Breakdown

The results panel shows total tax, effective rate, after-tax gains, NIIT surcharge (if applicable), loss carryover, and a tax breakdown chart. The 2024 Capital Gains Tax Rates table dynamically updates to reflect your selected filing status.

Formula

How Capital Gains Tax Is Calculated

The calculator applies a multi-step process that mirrors how the IRS actually computes capital gains tax:

1. Capital Gain / Loss Per Asset

Gain = (Sale Price − Purchase Price) × Quantity

2. Net Short-Term and Long-Term

Net Short-Term = Short-Term Gains − Short-Term Losses Net Long-Term = Long-Term Gains − Long-Term Losses

If one net is positive and the other negative, they offset each other. The $3,000 annual limit applies to any net capital loss that exceeds gains.

3. Short-Term Tax (Ordinary Income Rates)

Short-Term Tax = Net Short-Term Gains stacked on top of other income, taxed at marginal bracket rates (10%–37%)

4. Long-Term Tax (Preferential Rates)

Long-Term Tax = Net Long-Term Gains taxed at 0%, 15%, or 20% based on total taxable income bracket

5. Net Investment Income Tax (NIIT)

NIIT = min(Net Capital Gains, Total Income − Threshold) × 3.8% Threshold: $200,000 (single) / $250,000 (married)

6. Total Tax

Total = Short-Term Tax + Long-Term Tax + NIIT

Worked example: You are single with $80,000 ordinary income. You sell a stock held 18 months for a $20,000 long-term gain. Your total income = $100,000 — within the 15% long-term bracket (up to $518,900 for single filers in 2024). Long-term tax = $20,000 × 15% = $3,000. No NIIT (income under $200,000). Effective rate on the gain = 15%. If you had held less than one year, the same $20,000 would be taxed at your 22% marginal rate = $4,400 — a $1,400 difference from simply waiting a few more months.

2024 Tax Rates

2024 Capital Gains Tax Rate Reference

Long-Term Capital Gains Rates (Assets Held > 1 Year)

RateSingleMarried Filing JointlyHead of Household
0%$0 – $47,025$0 – $94,050$0 – $63,000
15%$47,025 – $518,900$94,050 – $583,750$63,000 – $551,350
20%Over $518,900Over $583,750Over $551,350

Short-Term Capital Gains = Ordinary Income Rates (Assets Held ≤ 1 Year)

RateSingleMarried Filing Jointly
10%$0 – $11,600$0 – $23,200
12%$11,600 – $47,150$23,200 – $94,300
22%$47,150 – $100,525$94,300 – $201,050
24%$100,525 – $191,950$201,050 – $383,900
32%$191,950 – $243,725$383,900 – $487,450
35%$243,725 – $609,350$487,450 – $731,200
37%Over $609,350Over $731,200

Source: IRS Rev. Proc. 2023-34. Brackets are for the 2024 tax year (filed in 2025). Special rates apply: collectibles are taxed at a maximum 28% long-term rate; certain unrecaptured Section 1250 gain on real estate is taxed at a maximum 25%.

Examples

Example Capital Gains Tax Calculations

Long-Term Stock Sale
Single filer, $75,000 salary, held 2 years
Purchase price$20,000
Sale price$35,000
Capital gain$15,000
Holding period2 years (long-term)
Long-term rate15%
Capital gains tax$2,250
After-tax gain$12,750
Short-Term Crypto Sale
Single filer, $95,000 salary, held 8 months
Purchase price$5,000
Sale price$18,000
Capital gain$13,000
Holding period8 months (short-term)
Ordinary income rate22%
Capital gains tax$2,860
After-tax gain$10,140
Tax Strategies

Legal Strategies to Reduce Capital Gains Tax

Hold for more than one year

The single most impactful move available to most investors. Holding an asset just one day past the one-year mark converts a short-term gain taxed at up to 37% into a long-term gain taxed at 0%, 15%, or 20%. For a $50,000 gain, the difference between 22% short-term and 15% long-term is $3,500 in tax savings.

Harvest tax losses to offset gains

Tax-loss harvesting means selling investments trading below your cost basis to generate a realized capital loss. These losses offset capital gains dollar-for-dollar, and up to $3,000 of net losses can offset ordinary income per year. The wash-sale rule prevents you from immediately repurchasing the same security — wait 31 days or buy a non-substantially-identical replacement.

Use the 0% long-term bracket strategically

In 2024, single filers with taxable income under $47,025 (or married under $94,050) pay 0% on long-term capital gains. If you are in a low-income year — retirement transition, sabbatical, or business loss year — consider realizing long-term gains to reset your cost basis at zero tax cost, a strategy called "gain harvesting."

Maximize tax-advantaged accounts

Capital gains inside a 401(k), IRA, or Roth IRA are not taxed when realized — they are only taxed upon withdrawal (traditional) or never (Roth). Holding high-growth, high-turnover investments in these accounts and keeping lower-turnover buy-and-hold positions in taxable accounts minimizes overall capital gains tax exposure.

Donate appreciated shares directly to charity

If you donate appreciated stock directly to a qualified charity instead of selling it first, you avoid capital gains tax entirely on the appreciation and receive a charitable deduction for the full fair market value. This is more tax-efficient than selling and donating the proceeds.

Use a Qualified Opportunity Zone (QOZ) fund

Investing capital gains in a Qualified Opportunity Zone fund within 180 days of the sale can defer the original gain until 2026 and eliminate gains on the QOZ investment held for at least 10 years. This is a complex strategy best executed with professional tax advice, but can be highly effective for large, illiquid gains.

Learn More

Short-Term vs. Long-Term, NIIT, and Special Asset Rules

The short-term vs. long-term distinction is the most important concept in capital gains taxation. Short-term gains are simply added to your ordinary income and taxed at the same rate as your wages. Long-term gains are stacked on top of ordinary income but taxed using a separate, lower rate schedule. The threshold is exactly one year — the day you sell must be at least 366 days after the day you bought for the holding period to qualify as long-term.

The Net Investment Income Tax (NIIT) is an additional 3.8% Medicare surtax introduced by the Affordable Care Act that applies to net investment income (which includes capital gains) for taxpayers above certain income thresholds: $200,000 for single filers, $250,000 for married filing jointly. The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold — meaning it applies to only the portion of gains that push you above the limit, not all gains.

Special rules for specific asset types: Not all assets follow the standard 0/15/20% schedule. Collectibles (art, coins, wine, antiques) are capped at a maximum 28% long-term rate, regardless of income — still preferential vs. 37% ordinary income, but not as low as stocks. Unrecaptured Section 1250 gain on the sale of depreciable real estate (the portion attributable to prior depreciation deductions) is capped at 25%. Cryptocurrency is treated as property — all the same short-term/long-term rules apply, and each trade (including crypto-to-crypto swaps) is a taxable event.

Capital loss rules: Capital losses must be applied in a specific order. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains. Any excess losses then cross over to offset gains of the opposite type. If total losses still exceed total gains, up to $3,000 of net loss can offset ordinary income per year. Losses beyond $3,000 carry forward indefinitely to future tax years — this carryover is tracked in the calculator's results panel.

For authoritative 2024 capital gains tax rules, see IRS Topic No. 409: Capital Gains and Losses and IRS Publication 550: Investment Income and Expenses, which covers all asset types, netting rules, carryovers, and the wash-sale rule in detail.

FAQ

Frequently Asked Questions

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

Short-term capital gains apply to assets held for one year or less. They are taxed as ordinary income at your marginal rate, which can be as high as 37% in 2024. Long-term capital gains apply to assets held for more than one year and are taxed at preferential federal rates of 0%, 15%, or 20% depending on your total taxable income. The one-year threshold makes timing of sales a critical part of investment tax planning.

What is the Net Investment Income Tax (NIIT) and who pays it?

The NIIT is a 3.8% Medicare surtax that applies to net investment income — including capital gains, dividends, and interest — for taxpayers whose modified adjusted gross income (MAGI) exceeds $200,000 (single) or $250,000 (married filing jointly). The surtax applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. For example, if your MAGI is $220,000 and your net investment income is $25,000, the NIIT applies to $20,000 (the excess over $200,000), not the full $25,000.

How does tax-loss harvesting work?

Tax-loss harvesting is the practice of selling investments at a loss to generate a capital loss that offsets capital gains on your tax return. Short-term losses first offset short-term gains (highest tax rate), and long-term losses first offset long-term gains. Any remaining net loss can offset up to $3,000 of ordinary income per year, with the rest carried forward to future years. The main constraint is the wash-sale rule: you cannot deduct the loss if you buy the same or a substantially identical security within 30 days before or after the sale.

Are capital gains taxed in states as well?

Yes, in most states. Most U.S. states that have an income tax treat capital gains as ordinary income and tax them at the state's ordinary income rate. A few states — including California, New York, and New Jersey — do not offer preferential rates for long-term gains, meaning your effective combined federal-plus-state rate can be substantially higher than the federal rate alone. Nine states (Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, Wyoming) have no state income tax on capital gains.

Do I owe capital gains tax if I sell my home?

Possibly, but most homeowners are sheltered by the Section 121 exclusion. If you owned and used the home as your primary residence for at least 2 of the 5 years before the sale, you can exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) from federal capital gains tax. Gains above the exclusion threshold are treated as long-term gains if the home was held over one year. Depreciation recapture on any portion of the home used for business is taxed at a maximum 25% rate.

How are cryptocurrency capital gains taxed?

The IRS treats cryptocurrency as property, not currency. Every sale, exchange, or use of crypto to purchase goods or services is a taxable event that may generate a capital gain or loss. This includes crypto-to-crypto trades — swapping Bitcoin for Ethereum is a taxable event at the time of swap, with gain measured as the fair market value of the received crypto minus your cost basis in the surrendered crypto. All standard short-term / long-term rules apply. The wash-sale rule currently does not apply to crypto (unlike stocks), making crypto a particularly useful asset for tax-loss harvesting at year-end.

Related Calculators