Capital Gains Tax Calculator 2026

Calculate federal capital gains tax on investment sales using 2026 IRS rates. Supports short-term and long-term gains.

Capital Gains Calculator📅 Updated for 2026⚡ Instant results

Formulas and 2026 figures checked & updated: July 2026

Trade Details

Holding Period

$
$1$5,000
$
$1$5,000
110,000
$
$0$100
$
$0$600,000

Used to determine your long-term capital gains bracket

Tax Breakdown

Cost Basis$5,000
Proceeds$8,000
Capital Gain$3,000
Tax Rate (15% LT)$450
Net Profit After Tax$2,550
Return on Investment60.00%

How to Use the Capital Gains Tax Calculator

  1. Enter your cost basis — the purchase price per share, including any commissions — and the number of shares.
  2. Enter your sale price per share and any sale commissions to calculate your total proceeds.
  3. Choose how long you held the asset: short-term (one year or less, taxed as ordinary income) or long-term (over a year, taxed at 0/15/20%).
  4. If short-term, enter your marginal ordinary income tax rate. If long-term, enter your other taxable income so the calculator can find your long-term bracket.
  5. Review your capital gain, the tax rate applied, and the tax owed.
  6. Check your net profit after tax and your return on investment. Example: buy $10,000 of stock and sell for $16,000 after two years as a single filer earning $80,000 — the $6,000 long-term gain is taxed at 15%, or $900, leaving a net profit of $5,100.

What This Calculator Does

The Capital Gains Tax Calculator estimates the federal tax owed on a stock, ETF, or fund sale, using 2026 IRS rules. The calculation differs dramatically depending on how long you held the investment: short-term gains (assets held one year or less) are taxed as ordinary income at your marginal tax rate, while long-term gains (held more than one year) get preferential 0%, 15%, or 20% rates based on your total taxable income.

The calculation is driven by your cost basis (purchase price plus any commissions), your sale proceeds, your holding period, and — for long-term gains — your total taxable income, since the 0%, 15%, and 20% brackets are based on total income including the gain itself. As a general benchmark, most middle-income investors land in the 15% long-term bracket: for 2026, single filers with taxable income between $49,450 and $545,500 owe 15% on long-term gains, those below that threshold pay 0%, and those above pay 20%. High earners may also owe an additional 3.8% Net Investment Income Tax (NIIT) on top of the capital gains rate once modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).

Use this calculator before selling a stock, ETF, or mutual fund position to estimate what you'll actually keep after taxes, to compare the tax cost of selling now versus waiting until you cross the one-year long-term holding threshold, or to plan year-end tax-loss harvesting by seeing how a capital loss elsewhere could offset the gain. It's especially useful when rebalancing a portfolio, funding a large purchase from a brokerage account, or deciding whether to realize gains in a lower-income year.

Formula

Tax = Gain × Rate, where Rate = Marginal Income Tax Rate (short-term) or 0% / 15% / 20% (long-term, based on income)

Capital gain equals your sale proceeds minus your cost basis. For short-term gains, that gain is taxed at the same marginal rate as your ordinary income (10–37% in 2026). For long-term gains, the rate depends on where your total income — including the gain — falls within the 2026 long-term brackets.

  • GainProceeds (sale price × shares − fees) minus cost basis (purchase price × shares + fees)
  • ST RateYour marginal ordinary income tax rate (10–37%) for short-term gains
  • LT Rate0%, 15%, or 20% for long-term gains, based on total taxable income (2026 brackets)
  • NetAfter-tax profit = Gain − Tax owed

Examples

Example 1: Long-term gain in the 15% bracket

You bought 100 shares at $50 and sold at $80 after holding for 2 years (long-term). Your other taxable income is $75,000 (single filer).

Capital gain = $3,000. Total income ($78,000) falls in the 15% long-term bracket, so tax = $450. Net profit after tax = $2,550 (a 17% after-tax return on the $5,000 cost basis).

Example 2: Short-term gain taxed as ordinary income

Same trade ($50 to $80, 100 shares, $3,000 gain), but held only 6 months (short-term), and you're in the 22% marginal tax bracket.

Tax = $3,000 × 22% = $660. Net profit after tax = $2,340 — about $210 less than the long-term scenario, purely due to the holding period.

Example 3: Large long-term gain pushing into the 20% bracket

A single filer with $480,000 of other taxable income sells investments for a $100,000 long-term gain.

The gain straddles brackets: a portion is taxed at 15% and the remainder at 20% since total income exceeds the 2026 top long-term threshold ($545,500). Effective tax owed is roughly $19,000–$20,000, leaving a net profit of about $80,000–$81,000.

Key Terms Explained

Capital Gain
The profit when you sell an asset for more than its cost basis. Long-term gains (held over a year) are taxed at lower rates than short-term gains.
Cost Basis
What you originally paid for an investment, including fees. Your capital gain is the sale price minus the cost basis.
Marginal Tax Rate
The tax rate applied to your last dollar of income — your top tax bracket. It's higher than your effective (average) rate.
Effective Tax Rate
Your total tax divided by your total income — the average rate you actually pay across all brackets.
Roth IRA
A retirement account funded with after-tax dollars. Contributions and earnings grow tax-free, and qualified withdrawals in retirement owe no tax.
Traditional IRA
A retirement account funded with pre-tax (or deductible) dollars. Contributions may lower your taxable income today, but withdrawals in retirement are taxed as ordinary income.

Continue Your Financial Planning

Learn brokerage account basicsUnderstand taxable accounts, investments, risk, and fees.Understand investment taxesLearn holding periods, capital-gains rates, and cost basis.

Related Guides

Capital Gains Tax GuideShort-term vs. long-term rates, 2026 brackets, and tax-loss harvesting.Investing & Brokerage GuideBrokerage account basics and the role of taxes in investing.
📐

Methodology

Long-term gain tax = gain × applicable LT rate (0/15/20% based on total income). Short-term gain tax = gain × ordinary income marginal rate. Net profit = gain − tax owed.

Frequently Asked Questions

What is the 2026 long-term capital gains tax rate?+

Long-term capital gains (assets held > 1 year) are taxed at 0%, 15%, or 20% depending on your income. Single filers pay 0% up to $49,450, 15% up to $545,500, and 20% above that. The net investment income tax (3.8%) applies to higher earners.

What is short-term capital gains tax?+

Short-term gains (assets held ≤ 1 year) are taxed as ordinary income at your marginal federal tax rate — the same bracket that applies to your salary income, ranging from 10% to 37%.

How do I calculate my capital gain?+

Capital gain = sale price × shares − cost basis (purchase price × shares) − commissions. If the result is positive, you owe tax. If negative, you have a capital loss you can use to offset gains or deduct up to $3,000 against ordinary income.

Do I owe capital gains tax on investments inside a 401(k) or IRA?+

No — investments held inside tax-advantaged retirement accounts like a 401(k), traditional IRA, or Roth IRA aren't subject to capital gains tax when sold within the account. Traditional account withdrawals are taxed as ordinary income in retirement, while qualified Roth IRA withdrawals are entirely tax-free. Capital gains tax only applies to investments sold inside a taxable brokerage account.

What is the wash sale rule?+

The wash sale rule disallows a tax loss if you sell a security at a loss and buy the same or a 'substantially identical' security within 30 days before or after the sale. If triggered, the disallowed loss is added to the cost basis of the new position rather than deducted immediately. The rule exists to prevent investors from claiming a tax loss while effectively keeping the same position.

Does capital gains tax apply to mutual funds and ETFs, not just individual stocks?+

Yes. Capital gains tax applies to any investment sold at a profit in a taxable account, including individual stocks, ETFs, mutual funds, and bonds. Mutual funds can also pass through 'capital gains distributions' to shareholders each year — even if you didn't sell any shares yourself — because the fund manager realized gains inside the fund. These distributions are taxed in the year received, the same as gains from a direct sale.

Can I save my results?+

Yes. Use “Save results” to store a snapshot. Without an account it remains in this browser. If you log in, saved scenarios sync securely to your SmartRates account so they are available on your other devices.

How do I share my calculation?+

Click “Share” in the toolbar to copy a link (or open your device’s share sheet). The link encodes your exact inputs, so whoever opens it sees the calculator pre-filled with the same numbers and the same result.

Can I email my calculator results?+

Yes. Click “Email results” to open your default email application with the current inputs, results, and calculator link already included. Review the message and choose the recipient before sending.

Can I export or print my results as a PDF?+

Yes. Click “Export PDF” to open a clean, printable summary of your inputs and results that you can save as a PDF or print. It includes a timestamp and a link back to the calculator.

How accurate are the calculator results?+

The arithmetic follows the formula and assumptions documented on this page. The result is still an estimate because actual rates, fees, taxes, timing conventions, eligibility rules, and provider calculations can differ. Use figures from your official quote, statement, contract, or tax form before making a financial decision.

Which inputs have the biggest effect on the result?+

Rate, time, starting balance, recurring payments or contributions, and fees usually have the largest effects. Change one input at a time to create a conservative, expected, and optimistic scenario instead of relying on a single forecast.

Are taxes, fees, and inflation included?+

Only when they appear as an input or are explicitly described in the methodology. Do not assume an omitted cost is zero. Review the formula and methodology sections to see exactly what is included before comparing the result with an outside quote.

Can this calculator predict future rates or returns?+

No. A calculator projects the assumptions entered; it cannot predict market returns, inflation, variable interest rates, tax-law changes, or provider decisions. Rerun the calculation with several assumptions to understand the range of possible outcomes.

Why might my lender, bank, broker, or tax software show a different result?+

Professional systems may use daily timing, transaction dates, compounding conventions, rounding rules, account-specific fees, credits, eligibility details, or regulations that a general-purpose calculator cannot know. A small difference can be rounding; a large difference usually means an assumption or included cost is different.

Disclaimer: Calculations are for informational purposes only and do not constitute professional financial advice. Please consult with a certified professional before making financial decisions.