Stock Calculator

About Stock Calculator

Stockcalculator.io is a free set of stock-math calculators built around one flagship: a multi-trade position calculator that folds any sequence of buys and sells — with commissions, in seven display currencies — into profit, average cost, and break-even. It has no accounts, no ads, no market data, and nothing to install. This page explains how it computes, how it rounds, and what standards the written content holds itself to.

Not advice — the posture, stated plainly

Everything on this site is educational arithmetic: the calculators transform numbers you type and recommend nothing. There are no buy or sell signals, no predictions, no live quotes (the ticker field is a label — it is never looked up), and the worked examples are historical scenarios, not suggestions. The tax field applies a single illustrative rate because capital-gains rules differ by country, holding period, and account type; nothing here computes your taxes. For decisions with real consequences, verify independently and consult a licensed professional.

Methodology: the exact-decimal engine

Most calculators compute in binary floating point, which cannot represent most decimal numbers exactly — the classic symptom is 0.1 + 0.2 = 0.30000000000000004, and in money math it surfaces as impossible cents. This site's engines instead keep every value as an exact ratio of integers, so share counts, costs, and P/L are exact by construction. Nothing is rounded until the moment a result is displayed.

The position model: the sequential average-cost method. Each buy adds its cost (plus its fee) to the position; each sell removes shares at the running average and realizes the difference (minus its fee). Selling more than the position holds is an error, stated in words — never a silent negative position. FIFO and LIFO lot accounting are deliberately out of scope: brokers and tax authorities differ, and a calculator that silently picked one would be wrong for someone in a way they couldn't see.

The rounding rule: one rounding step, at display time, half away from zero. Currency amounts follow their currency's convention ($1,234.50; ¥1,235 with no decimals; ₿ up to eight, trailing zeros trimmed). Percentages and ratios follow your precision control (.0← / .00→, 0–8 places, spreadsheet-style padding); changing precision re-renders from the stored exact value, so rounding error never accumulates.

The one exception: CAGR takes an nth root, which is irrational for almost all inputs — no exact representation exists. That single computation runs in double-precision floating point and displays at up to 4 decimal places, roughly eleven orders of magnitude above the float error. The exception is recorded in the repository as an architecture decision (ADR-002) and covered by an error-bound test.

Testing: a golden acceptance table — the position sequences, fee variants, the oversell path, the target-average solver, sizing floors, DRIP invariants (zero growth reduces exactly to compound interest), recovery values, and the legacy link adapter decoding real captured vendor URLs — runs in continuous integration on every change. If a displayed result would change, the build fails.

Content standards

Articles cite peer-reviewed research where they make empirical claims, linked by DOI at the claim itself — never as decoration. Every DOI is resolved against the Crossref registry before first use, and an automated job re-checks all cited links weekly. Where the evidence is thin or doesn't cover a situation, the article says so. Every article shows its published date and, when it has been re-checked by a person, a last-reviewed date. No statistic appears without a source or a derivation you can follow, and no article tells you what to buy or sell — they report what studies found.

Privacy, in one paragraph

Calculations run entirely in your browser; the numbers you type are never transmitted. The site stores three small preferences on your device (theme, decimal precision, display currency) and currently loads no analytics at all. If lightweight analytics are added, they will run only on this site's production domain and never see input values. The privacy policy is the binding version.

Legacy links

The previous version of this site shared calculations as ?data= URLs. Those links keep working: an adapter decodes them into the current format on arrival and rewrites the address bar. If a very old link fails to parse, the calculator opens with defaults rather than an error.

Who builds this

Stock Calculator is built and maintained by the small team behind Percentage Calculator, Screen Test Pro and AREALME — free browser tools with the same house rules: prerendered pages, no frameworks, honest content, and instruments that work the moment they load. The version history is public in the changelog.