Calculatormatics

Last updated: April 2026 · Reviewed by Alex Morgan, CFP

Capital Gains Tax Calculator

A free capital gains tax calculator for the 2026 US tax year that estimates the federal tax on the sale of stocks, mutual funds, ETFs, real estate, cryptocurrency, and other investment assets. Enter the sale price, your cost basis, your filing status, your other taxable income, and how long you held the asset — the calculator distinguishes short-term gains (held one year or less, taxed as ordinary income at your marginal bracket) from long-term gains (held more than one year, taxed at the preferential 0%, 15%, or 20% rates) and applies the correct schedule. Long-term thresholds for 2026 single filers: 0% on income up to $48,350, 15% from $48,350 to $533,400, and 20% above $533,400 (married filing jointly thresholds are roughly double). The result shows the gain, the rate applied, the tax owed, and your effective rate. Note: this tool covers federal capital gains tax only — it does not include state tax, the Net Investment Income Tax (3.8% surcharge above $200K/$250K), or wash-sale adjustments. Enter your numbers below to estimate your liability.

Capital Gain: $10,000.00
Tax Rate: 15% long-term
Capital Gains Tax: $1,500.00
Total Tax: $1,500.00
Net Proceeds After Tax: $8,500.00
Cost Basis: $10,000.00 Sale Price: $20,000.00 Capital Gain = $20,000.00 - $10,000.00 = $10,000.00 Holding Period: Long-term (>= 1 year) Annual Income: $75,000.00 LT Rate: 15% (income in 15% bracket) Capital Gains Tax = $10,000.00 × 15% = $1,500.00 ──────────────────────────────────────── Capital Gain: $10,000.00 Capital Gains Tax: $1,500.00 Total Tax: $1,500.00 Net Proceeds: $8,500.00
Advertisement

What Are Capital Gains?

A capital gain is the profit you make when you sell a capital asset — stock, real estate, mutual funds, bonds, cryptocurrency, or collectibles — for more than you paid for it. The amount you paid is called your cost basis, which includes the original purchase price plus any commissions, fees, or improvements (for real estate).

Capital Gain = Sale Price − Cost Basis

If you sell for less than your basis, you have a capital loss, which can offset capital gains dollar-for-dollar and up to $3,000 of ordinary income per year. Excess losses carry forward indefinitely.

Short-Term vs. Long-Term Capital Gains

The single most important factor determining how much tax you pay on a capital gain is how long you held the asset before selling.

2026 Long-Term Capital Gains Tax Rates

Source: IRS Rev. Proc. 2025-32.

Rate Single Filers Married Filing Jointly Head of Household
0% Up to $49,450 Up to $98,900 Up to $66,200
15% $49,450 – $545,500 $98,900 – $613,700 $66,200 – $579,600
20% Over $545,500 Over $613,700 Over $579,600

These thresholds are based on your total taxable income, not just the gain itself. A single filer with $40,000 of wages who sells stock with a $20,000 long-term gain has $60,000 of taxable income — part of the gain falls in the 0% bracket, the rest in the 15% bracket.

Worked Example (2026)

Sarah (single filer) has $50,000 in W-2 wages and sells stock she has held for 18 months with a $30,000 long-term gain. Her taxable income is $80,000 (before standard deduction). After the $16,100 standard deduction, taxable income = $63,900.

Long-term gain: $30,000 The 0% bracket ends at: $49,450 (2026 single) Gain in 0% bracket: $49,450 − $33,900 (wages after deduction) = $15,550 at 0% Gain in 15% bracket: $30,000 − $15,550 = $14,450 at 15% Tax on long-term gains: $0 + ($14,450 × 15%) = $2,168

Net Investment Income Tax (NIIT)

High-income taxpayers owe an additional 3.8% Net Investment Income Tax on investment income — including capital gains, dividends, interest, and rental income — above these thresholds:

The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold. This means the top effective federal rate on long-term capital gains is 23.8% (20% + 3.8%) for high earners, and up to 40.8% for short-term gains (37% + 3.8%).

How to Reduce Capital Gains Tax

1. Hold for the Long-Term

The simplest strategy: wait at least 366 days before selling any appreciated asset. Converting a short-term gain to a long-term gain can reduce your tax rate by 15–22 percentage points. On a $50,000 gain, that is $7,500 to $11,000 in tax savings just by waiting.

2. Tax-Loss Harvesting

Deliberately sell investments that have declined in value to generate losses that offset your gains. If you have $20,000 in realized gains and $8,000 in harvested losses, you only pay tax on $12,000. Losses in excess of gains offset up to $3,000 of ordinary income per year; the remainder carries forward.

3. Donate Appreciated Assets

If you donate stock or other appreciated assets directly to a qualified charity (instead of selling first and donating cash), you avoid capital gains tax entirely and receive a charitable deduction for the full fair market value. This is one of the most tax-efficient ways to give.

4. Use Tax-Advantaged Accounts

Assets held inside a 401(k), IRA, Roth IRA, or HSA do not generate capital gains tax when you sell or rebalance. Holding highly appreciated, high-turnover investments inside these accounts first (asset location) can meaningfully reduce your lifetime tax bill.

5. Opportunity Zone Investments

Reinvesting capital gains into a Qualified Opportunity Fund within 180 days can defer the original gain until December 31, 2026, and eliminate all future appreciation on the opportunity zone investment after a 10-year hold.

Frequently Asked Questions

What is a step-up in basis and how does it reduce capital gains tax?

When you inherit an asset, its cost basis is "stepped up" to the fair market value on the date of the original owner's death. This means if your parent bought stock for $10,000 that was worth $150,000 when they died, your basis is $150,000. If you sell immediately, you owe zero capital gains tax on the $140,000 appreciation. The step-up in basis is one of the most powerful estate planning tools available and effectively eliminates capital gains tax on assets held until death.

What is a 1031 exchange and how does it defer capital gains on real estate?

A 1031 exchange (named after IRC Section 1031) allows real estate investors to defer paying capital gains tax when they sell an investment property by reinvesting the proceeds into a "like-kind" property within a strict timeline: 45 days to identify a replacement property and 180 days to close. You must use a qualified intermediary to hold the funds between transactions. The tax is deferred — not eliminated — until you eventually sell without doing another exchange. 1031 exchanges are available only for investment or business property, not your primary residence.

Are cryptocurrency gains subject to capital gains tax?

Yes. The IRS treats cryptocurrency as property, not currency. Every time you sell, exchange, or use crypto to buy goods or services, you trigger a taxable event. Gains held less than one year are short-term and taxed as ordinary income. Gains held more than one year qualify for long-term rates (0%, 15%, or 20%). You must track your cost basis for every transaction. The IRS now asks about crypto on Form 1040, and crypto exchanges issue 1099 forms. Tax-loss harvesting is allowed and the wash-sale rule does NOT currently apply to crypto (though Congress has proposed changing this).

Can I exclude capital gains on the sale of my primary home?

Yes, under IRC Section 121. If you owned and lived in the home as your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 of gain (single filers) or $500,000 (married filing jointly). You can use this exclusion once every two years. The exclusion does not apply to gains from depreciation recapture if you ever used the home for business purposes, and it does not reduce the sale price for state capital gains tax purposes in all states. Partial exclusions are available if you had to sell early due to a job change, health issue, or unforeseen circumstance.

What is the wash sale rule?

The wash sale rule (IRC Section 1091) prevents you from claiming a tax loss if you buy the same or "substantially identical" security within 30 days before or after the sale. If you sell 100 shares of Apple at a loss and buy 100 shares of Apple the next day, the loss is disallowed — it is added to the basis of the replacement shares instead. The 30-day window applies both before AND after the sale (a 61-day window total). To harvest a tax loss legitimately, either wait 31 days to repurchase, or buy a similar but not identical fund in the interim (e.g., sell S&P 500 ETF, buy total market ETF).

What are Qualified Opportunity Zones and how do they defer capital gains?

Qualified Opportunity Zones (QOZs) are designated low-income census tracts where you can defer and potentially reduce capital gains tax by investing unrealized gains in a Qualified Opportunity Fund (QOF) within 180 days of a sale. If you hold the QOF investment for at least 10 years, any appreciation in the QOF itself is completely tax-free. The original deferred gain must be recognized by December 31, 2026 regardless of holding period. QOZ investments can be complex and illiquid — always consult a tax advisor before investing.

Advertisement