Capital Gains Calculator
Enter the purchase price, sale price, and number of shares to find the capital gain or loss.
Result
How it is calculated
The tool works per share and then scales up: gain = (sell_price − buy_price) × shares and return % = (sell_price − buy_price) / buy_price × 100. Prices are per share or per unit in the same currency, and the share count can be fractional. The status line says gain, loss or break-even depending on the sign of the result; a loss is shown as a negative number. The buy price must be above zero and the sale price may be zero (a total loss). The tool does not subtract brokerage commissions, fees or taxes, and it does not apply a short-term or long-term tax rate, so the figure is the pre-tax gain on the price movement only.
Worked example
You bought 120 shares at $42.50 and sold them at $58.75. Price change per share: 58.75 − 42.50 = 16.25. Gain: 16.25 × 120 = $1,950.00. Return: 16.25 / 42.50 = 0.3824, or 38.24%. The status reads Capital gain. If the same shares had been sold at $30 instead, the result would be a loss of $1,500.00 and a return of −29.41%.
Common mistakes
- Entering the total amount paid as the buy price instead of the price per share; the tool multiplies by the share count itself.
- Ignoring commissions and fees: they reduce the real profit, but this tool does not subtract them, so enter an adjusted price or deduct them yourself.
- Treating the displayed gain as the taxable amount: the result is before tax and no holding-period rule is applied.
- Mixing currencies, for example buying in euros and entering the sale price in dollars without converting.
- Confusing return with gain: a 38% return is a ratio on cost, not a money amount.
Sources
- Topic no. 409, Capital gains and losses — Internal Revenue Service
About this calculator
A capital gain (or loss) is the difference between what you paid for an asset and what you sold it for, multiplied by the number of shares or units involved: (sale price minus purchase price) times shares. The return expresses that gain as a percentage of the original cost basis, making it easy to compare the performance of positions bought at different prices.
Investors and tax filers use this figure for far more than bragging rights — most tax systems tax capital gains differently depending on how long the asset was held, commonly splitting gains into short-term (held roughly a year or less, often taxed like ordinary income) and long-term (held longer, often at a reduced rate). Knowing the exact gain or loss on a sale is the starting point for that tax calculation as well as for tracking portfolio performance.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Fees change the picture, and the tool leaves them out unless you add them. Buying 100 shares at 40 and selling at 58 shows 1,800.00 and 45.00%. If you paid 0.50 per share in costs on each side, enter 40.50 and 57.50 to get 1,700.00 and 41.98%. The figure is a pre-tax price result, so holding-period rules still apply on top. Do you track your fees per share or per trade?