🧮
🧮 Math & statistics

Benford's Law Calculator (first-digit test of your data)

Results update as you type.

Your numbers

Understanding the Benford's law calculator — concept and principle

This calculator tests whether the first digits of your data follow Benford's law. It counts leading digits 1–9, compares them with the Benford proportions, and reports a chi-square test, a p-value and the mean absolute deviation. Auditors, data journalists and students use it as a quick screen for unusual number patterns.

First digits of 40 amountsFirst digits of 40 amounts123456789bars: sample · red: Benford47.5 %Leading 147.5 % vs 30.1 %χ² (8 df)7.268MAD3.96 ppp-value0.5081
Benford expects log₁₀(1 + 1/d): about 30 % of first digits are 1.

How it is calculated

Benford proportion P(D) = log₁₀(1 + 1/D), for D = 1 … 9

Expected count = n × P(D)

χ² = Σ (observed − expected)² ÷ expected, with 8 degrees of freedom

Mean absolute deviation (MAD) = average of |observed share − P(D)| over the 9 digits

The principle

Many data sets that span several orders of magnitude, such as invoice amounts, populations or river lengths, have leading digits that are far from uniform: 1 leads about 30.1 % of the time, 2 about 17.6 %, and 9 only about 4.6 %. One intuitive reason: to grow from a leading 1 to a leading 2 a number must double, while going from 9 to 10 is only an 11 % step, so values that grow by percentages spend longest with small leading digits. Data that are assigned (phone numbers), capped or confined to a narrow range (adult heights) do not follow the law.

Worked example

Default input: 40 sample amounts.

  1. Leading digits counted: 1 → 19, 2 → 7, 3 → 3, 4 → 3, 5 → 1, 6 → 2, 7 → 2, 8 → 1, 9 → 2 (40 values).
  2. Share with leading 1 = 19 ÷ 40 = 47.5 %, against 30.1 % expected; the most common digit is 1.
  3. χ² over the nine digits = 7.268, with 8 degrees of freedom.
  4. p-value = 0.5081, so no significant difference (p ≥ 0.05).
  5. MAD = 3.96 percentage points; because n is small, treat the p-value as rough.

How to read the result

A large p-value means the data are consistent with Benford's law; a small one (below 0.05) means they differ by more than chance would usually produce. With very large data sets, even tiny, harmless deviations become "significant", which is why the MAD is also reported. A deviation is a reason to look closer, never proof of fraud: rounding, price points, minimum amounts and the nature of the data all cause legitimate departures.

Common mistakes

Keep in mind: Benford analysis is a screening tool. Any suspicion must be checked against the underlying records by a qualified person.

Frequently asked questions

What does Benford's law say?

In many natural data sets the first digit d appears with probability log₁₀(1 + 1/d), so 1 is most common.

How many data points do I need?

The more the better; with fewer than about 110 values some expected counts fall below 5 and the chi-square test is only approximate.

Does all data follow Benford's law?

No. It needs data spread over several orders of magnitude and not assigned by people.

Sources: E. W. Weisstein, "Benford's Law", Wolfram MathWorld · F. Benford (1938), "The law of anomalous numbers", Proceedings of the American Philosophical Society 78(4)

Checked 9 Nov 2026. Weisstein, E. W., “Benford’s Law”, Wolfram MathWorld (P(D) = log₁₀(1 + 1/D) for D = 1, …, 9, with the table 0.30103, 0.176091, …, 0.0457575; history from Newcomb 1881 and Benford 1938). Chi-square goodness-of-fit test with 9 − 1 = 8 degrees of freedom (standard formula).

🧮 All math & statistics tools →🌍 Calculators by country →