Skip to content
100% local

Benford's law analyzer

Compare the first-digit distribution of a data set against Benford's law.

Input
Output

Benford's law analyzer

Paste a column of numbers — financial figures, transaction amounts, populations, anything with a few hundred entries or more — and this tool counts how often each digit from 1 to 9 appears first, then compares that against Benford's law. In naturally occurring data the leading digit isn't uniform: a 1 shows up first about 30% of the time, a 9 barely 5%. A data set that drifts far from that curve is worth a second look, which is why auditors and fraud examiners use this test as a first screen.

Values can be separated by spaces, commas or new lines — auto-detect handles a mixed paste with no setup. Decimal places sets how many digits the percentage columns show. The deviation formula switches between the population and sample convention for the spread of the nine digit differences, the same choice behind any standard deviation. Intermediate steps adds the raw extracted digits, a count row and a row of differences, showing how the numbers were built. Ignore invalid values skips text, blanks and zeros instead of stopping on the first one; zero has no leading digit under Benford's law.

The result reports how many values were analyzed and skipped, the mean absolute deviation between observed and expected percentages — read out as close, acceptable, marginal or nonconformity using standard forensic-accounting thresholds — and the standard deviation of the differences. None of this proves fraud alone: small samples and digit-heavy data, like invoice numbers, also drift from the curve. A large deviation is a reason to look closer, not a verdict.

Everything runs locally in your browser: pasted numbers are never uploaded. Copy the report, download it as a .txt file, clear the panel, or send the output back into the input to rerun with different options.

FAQ

What exactly is Benford's law?
It's the observation that in many naturally occurring collections of numbers, the leading digit 1 appears about 30% of the time, 2 about 18%, down to 9 at under 5% — following the formula log₁₀(1 + 1/d). It shows up in financial statements, populations, physical constants and stock prices, but not in numbers with an artificial range, like phone numbers or lottery picks.
How large should my data set be for the result to mean anything?
A few hundred values at minimum; a few thousand is much more reliable. With only five or ten numbers, the observed percentages will bounce around wildly and a "nonconformity" reading is expected, not suspicious.
What does the mean absolute deviation (MAD) tell me?
It's the average gap between the observed and expected percentage across all nine digits. The tool labels it close, acceptable, marginal or nonconformity using the boundary values commonly used in forensic accounting — lower is closer to what Benford's law predicts.
Does a nonconformity result mean the data is fraudulent?
No. It only means the leading-digit distribution differs from Benford's law, which can also happen with a small sample, data restricted to a narrow range, or numbers that are assigned rather than measured. Treat it as a signal to investigate further, not a conclusion.
Is my data uploaded anywhere?
No. The analysis runs entirely in your browser using local JavaScript — the numbers you paste never leave your device.