# Capital Gains Tax Calculator

- Link: https://bestwebdeveloper.org/tools/capital-gains-tax-calculator/
- Published: 2026-10-15T18:07:25+00:00
- Author: Best Web Developer

## What the Capital Gains Tax Calculator does

A capital gain is the sale price minus your cost basis and selling costs. In the
US, assets held for more than a year qualify for lower long-term rates, while short-
term gains are taxed as ordinary income. This calculator applies the right rate 
for your holding period.

## Formula

 * Gain = sale price − cost basis − costs
 * Long-term if held more than 12 months (US rule)
 * Tax = gain × applicable rate (+ 3.8% NIIT if it applies)

## Worked example

Using the starting values in the calculator above:

  |  Input |  Value |  
   |  Purchase price (cost basis) |  $20,000 |  
 |  Sale price |  $35,000 |  
 |  Buying and selling costs |  $500 |  
 |  Months held |  18 |  
 |  Short-term rate (ordinary income) |  24% |  
 |  Long-term rate |  15% |  
 |  Add 3.8% net investment income tax |  No |

  |  Result |  Value |  
   |  Estimated tax |  $2,175 |  
 |  Capital gain |  $14,500 |  
 |  Gain type |  Long-term |  
 |  Rate applied |  15.0% |  
 |  Gain after tax |  $12,325 |  
 |  Tax difference under the other type |  $1,305 |

## How to read the result

If a sale is close to the one-year mark, the difference column shows what waiting
would save or cost.

Losses can offset gains, and in the US up to 3,000 dollars of net capital losses
a year can offset ordinary income.

_Estimates only, not tax advice. Rates and thresholds change; confirm current figures
with your tax authority or adviser._

## Related calculators

 * [Foreign Earned Income Exclusion Calculator](https://bestwebdeveloper.org/tools/foreign-earned-income-exclusion-calculator/):
   Estimate the US foreign earned income exclusion, prorated for qualifying days,
   plus the foreign housing exclusion.
 * [Mileage Reimbursement Calculator](https://bestwebdeveloper.org/tools/mileage-reimbursement-calculator/):
   Calculate mileage reimbursement or a mileage deduction at a per-mile rate, and
   compare it with the trip’s fuel cost.
 * [Depreciation Calculator](https://bestwebdeveloper.org/tools/depreciation-calculator/):
   Calculate depreciation schedules with straight-line, double declining balance
   or sum-of-the-years’-digits methods.
 * [Bank Reconciliation Calculator](https://bestwebdeveloper.org/tools/bank-reconciliation-calculator/):
   Reconcile a bank statement with your books by adjusting for deposits in transit,
   outstanding cheques, fees and errors.

Browse every calculator in [Tax and Accounting Calculators](https://bestwebdeveloper.org/tool-category/tax-accounting-calculators/),
or talk to us about [finance workflow automation](https://bestwebdeveloper.org/services/ai-workflow-integration/).
