Finance

Capital Gains Calculator

Compute the tax on an investment gain across the actual bracket structure — including the zero-per-cent band that most calculators, and most investors, forget exists.

Capital Gains Calculator

Results recalculate instantly on every keystroke. Nothing you type is transmitted.

The Investment
$
$
months
Your Tax Position
$
%
Capital Gains Tax Due
Federal long-term rates, 2024 single-filer thresholds
Total Gain
Effective Tax Rate On The Gain
Taxed At 0%
Taxed At 15%
Taxed At 20%
You Keep
If It Had Been Short-Term
Saved By Holding Past One Year

What this result does not account for

  • Results are a model, not a quotation — an institution's own figures govern.
  • Every input is an assumption; change one and the answer changes with it.
  • Rounding is applied only at the display layer, so totals may differ by a cent from a statement that rounds each line.
Zero-Server Execution Updated 11 Aug 2026 Reviewed by Imran S. Qureshi, CFA IEEE-754 Double Precision

In short: A $48,500 gain on a $30,000 investment held 3.5 years by a single filer with $32,000 of other income is taxed at 0% on the first $15,025 and 15% on the remainder: $5,021.25 in total, an effective rate of 10.35%. Held under a year it would have been taxed as income — $10,670 at 22%.

Formula

Gain = Sale − Basis  ·   Tax = ∑ (gain in bandk × ratek)  ·   bands are filled from your other income upward

The gain stacks on top of your other taxable income. The 0% band is whatever remains below the threshold once that income is counted, which is why two people with the same gain can pay very different tax.

Worked Example

  1. Compute the gain. $78,500 − $30,000 = $48,500.
  2. Confirm long-term treatment. 42 months is beyond twelve, so capital gains rates apply rather than income rates.
  3. Find the room in the 0% band. $47,025 threshold − $32,000 of other income = $15,025 taxed at nothing.
  4. Tax the remainder at 15%. $33,475 × 15% = $5,021.25.
  5. Read the effective rate. $5,021.25 ÷ $48,500 = 10.35%, not the 15% almost everyone assumes.

Analyst's note. The phrase 'the 15% capital gains rate' is wrong for a large number of taxpayers. Gains stack on top of ordinary income, so anyone whose income sits below the threshold has a genuine 0% band available — $15,025 of it here, worth $2,253.75. That band is also the basis of deliberate gain harvesting: realising gains up to the threshold in low-income years and immediately repurchasing resets your basis higher at no tax cost, since the wash-sale rule applies to losses, not gains.

Strengths & Limits Of This Model

Where this engine is strong

  • Runs entirely in your browser — no figure you type is transmitted or stored.
  • Shows the full working, so every number can be traced and challenged.
  • Free, unmetered and free of affiliate incentives.

Where it stops

  • Generalised assumptions cannot capture every individual circumstance.
  • Jurisdiction-specific rules and mid-year changes may not be reflected.
  • A model output is not a substitute for a professional review of your position.

Risk & accuracy notice. Figures produced here are estimates derived from the inputs you supply. They are not a forecast, an offer, or a guarantee of any outcome, and no result should be read as a promise of future performance. Rates, thresholds and statutory rules change, and your own circumstances may differ materially from the assumptions modelled.

Practical Use Cases

Timing a sale around the twelve-month line

Crossing from short to long-term treatment is worth $5,648.75 on this gain. If you are within weeks of the anniversary, the arithmetic almost always favours waiting. Check the trade-level figures with the Stock Profit Calculator.

Harvesting gains in a low-income year

A career break, a sabbatical or early retirement before pensions begin can open a large 0% band. Realising gains up to the threshold and repurchasing immediately raises your basis for free. Model the income gap first with the Budget Calculator.

Deciding which account to sell from

Gains inside a retirement account attract no capital gains tax at all, so the sale order across accounts materially changes your tax bill. Coordinate the sequence with the Retirement Calculator and the Roth IRA Calculator.

Methodology & Editorial Standards

The engine applies 2024 US federal long-term capital gains thresholds for a single filer, stacking the gain on top of the other taxable income you enter and filling the 0%, 15% and 20% bands in order — which is how the tax genuinely works, and why the effective rate is usually below the marginal one. Short-term gains are taxed at the ordinary rate you supply. Thresholds are indexed annually and differ for married and head-of-household filers, so verify the current figures for your status. The 3.8% net investment income tax, state taxes, the qualified small business stock exclusion, collectibles and unrecaptured section 1250 gains are not modelled. This is not tax advice. The engine implements the standard published formula for this calculation. Inputs are validated for domain and sign before evaluation, and any undefined case returns an em-dash rather than a spurious value.

Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.

This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.

Imran S. Qureshi, CFA Head of Quantitative Modelling · ApexConverter

Eighteen years structuring and stress-testing debt portfolios across corporate treasury and institutional real-estate finance. Last reviewed: 11 August 2026.

Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.


Capital Gains Calculator — 20 Expert FAQs

20 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.

What is the capital gains tax rate?

There is no single rate. US long-term gains are taxed in bands of 0%, 15% and 20%, and the gain stacks on top of your other income to determine which bands it falls in. On these figures the effective rate is 10.35%, not 15%.

How does the 0% capital gains band work?

If your total taxable income including the gain stays below the threshold — $47,025 for a single filer in 2024 — that portion of the gain is taxed at nothing. Here $32,000 of other income leaves $15,025 of room, worth $2,253.75 in saved tax.

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

Assets held twelve months or less are short-term and taxed as ordinary income; beyond twelve months they qualify for capital gains rates. On this gain that is $10,670 against $5,021.25 — a $5,648.75 difference for the same profit.

Does the gain push me into a higher tax bracket?

It can push the gain itself into higher capital gains bands, and it raises your adjusted gross income, which can affect credits, deductions and Medicare premiums. It does not change the rate applied to your ordinary income.

What is gain harvesting?

Deliberately realising gains up to the top of the 0% band in a low-income year, then repurchasing immediately to reset your cost basis higher at no tax cost. The wash-sale rule restricts losses, not gains, so the repurchase is permitted.

Can I offset gains with losses?

Yes. Realised losses offset realised gains, and in the US a limited amount of net loss can offset ordinary income each year with the remainder carried forward indefinitely. Beware the wash-sale rule when repurchasing.

What is the net investment income tax?

An additional 3.8% on investment income for taxpayers above certain income thresholds. It is not included in these figures, so higher earners should add it: it would take a 15% band to 18.8% and a 20% band to 23.8%.

Do these thresholds apply to married couples?

No. The engine uses 2024 single-filer thresholds. Married filing jointly has roughly double the bands, and head of household sits between. Verify the figures for your status and year before relying on the result.

How is the cost basis determined?

Generally what you paid plus acquisition costs such as commission. It is adjusted for stock splits, return-of-capital distributions and reinvested dividends, which are frequently missed and cause overstated gains.

Are gains inside a retirement account taxed?

No. Trading within an IRA or 401(k) creates no capital gains tax at all. Traditional accounts are taxed as ordinary income on withdrawal; qualified Roth withdrawals are untaxed entirely. This is why asset location matters as much as asset allocation.

What about my main home?

The US allows a substantial exclusion of gain on the sale of a principal residence, subject to ownership and use tests. Property has its own rules including depreciation recapture on rentals, and is outside the scope of this engine.

When is the tax actually payable?

In the tax year the sale is completed, though large gains may trigger estimated payment requirements during the year to avoid penalties. Selling in early January rather than late December defers the liability by a full year.

Does inflation reduce my taxable gain?

Not in the US, which taxes nominal gains with no indexation. A gain that merely kept pace with inflation is still taxed in full, which is a real cost on very long holdings.

What if I inherited the asset?

Inherited assets generally receive a stepped-up basis to market value at the date of death, often eliminating the accumulated gain entirely. Gifted assets usually carry over the donor's original basis instead.

Is this tax advice?

No. It is a calculation using published federal thresholds for one filing status, and it excludes state tax, the net investment income tax and numerous special cases. Confirm your position with a qualified tax professional before acting.

Is this capital gains calculator free to use?

Yes. It is free, requires no account, and has no usage limits. ApexConverter is funded by contextual advertising, never by selling user data.

Is my data sent to a server?

No. The engine runs as Vanilla JavaScript inside your browser under our Zero-Server Client-Side Execution model. Your figures are computed locally and are never transmitted, logged, or stored.

How accurate is this calculator?

It applies the standard closed-form formula in IEEE-754 double precision, rounding only at the display layer. The engine is reconciled against an independent reference implementation before release.

Does it work on mobile?

Yes. The interface is mobile-first with numeric keypad hints and is tested down to a 320-pixel viewport with no horizontal scrolling.

Can I use it offline?

Largely, yes. Because computation is client-side, the page continues to calculate without a network connection once it has loaded.

Related Finance Engines