Benford's Law Calculator

Benford's Law Calculator

Count the leading digits in a set of numbers and test them against Benford's law, with a chi-square test and Nigrini's conformity rating, the screen used in forensic accounting.

P(first digit = d) = log₁₀(1 + 1/d)

Paste amounts, populations, counts and so on. Zeros are skipped; signs are ignored.

Paste at least 10 numbers to test

What Is Benford's Law?

Benford's law says that in many naturally occurring collections of numbers, the leading digit is 1 about 30% of the time, and each larger digit is less common, down to 9 at under 5%. Intuition expects each digit 1–9 to lead about 11% of the time.

It applies to data that span several orders of magnitude and grow multiplicatively: populations, river lengths, share prices, invoice amounts. To go from a leading 1 to a leading 2, a number must double, but going from 9 to 10 needs only an 11% rise, so numbers spend longer starting with 1.

Auditors use it as a screen. Invented figures tend to have too few 1s and too many 5s to 9s. Tax authorities and forensic accountants flag accounts that break the pattern for a closer look.

Benford's Law Formula

As given in Benford (1938) and Nigrini, Benford's Law (2012), for the conformity bands. See Sources.

1. Expected share of each first digit

P(d) = log₁₀(1 + 1/d), d = 1 … 9

2. Chi-square test

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

3. Mean absolute deviation (Nigrini)

MAD = Σ |observed share − P(d)| ÷ 9

Up to 0.006 is close conformity, 0.006–0.012 acceptable, 0.012–0.015 marginal, above 0.015 nonconformity. Unlike χ², MAD doesn't flag tiny deviations just because the data set is huge.

Worked Example: Powers of 2

Given:
The first 1,000 powers of 2: 2, 4, 8, 16, 32, 64, 128 … up to about 1.07 × 10³⁰¹. Each doubles the last, the kind of growth Benford's law describes.
Step 1:
Count the leading digits 1 to 9:
301, 176, 125, 97, 79, 69, 56, 52, 45
Step 2:
Compare with Benford's expected counts:
301, 176.1, 124.9, 96.9, 79.2, 66.9, 58, 51.2, 45.8
Step 3:
Test statistics:
χ² = 0.159, p = 1 · MAD = 0.0007
Result:
Close conformity

301 of 1,000 start with a 1, against 301 expected, and every other digit is within a few counts of Benford. Testing only the first 50 powers gives a MAD of 0.024, rated "nonconformity", even though the numbers follow the same law: the bands assume a large data set.

Benford's Law First-Digit Table

Expected share of each leading digit under Benford's law and under equal chances
First digitBenfordIf all equalExpected in 1,000 numbers
130.1%11.1%301
217.6%11.1%176
312.5%11.1%125
49.7%11.1%97
57.9%11.1%79
66.7%11.1%67
75.8%11.1%58
85.1%11.1%51
94.6%11.1%46

Common Benford's Law Mistakes

  • Testing data with a narrow range. Adult heights in cm all start with 1; house numbers on one street don't span orders of magnitude. Benford doesn't apply.
  • Testing assigned numbers. Phone numbers, postcodes and invoice IDs are labels, not quantities.
  • Treating a mismatch as proof of fraud. It's a red flag for investigation. Price points like £9.99 or capped amounts break Benford innocently.
  • Relying on χ² for huge data sets. With 100,000 numbers, trivial deviations are "significant". MAD is the better guide.

Benford's Law FAQs

Why does 1 appear so often?

For quantities that grow by multiplication, the leading digit is 1 across a much wider stretch of each order of magnitude (10–19.99 is a doubling) than 9 is (90–99.99).

How many numbers do I need?

At least 100 for a meaningful test, and ideally 1,000 or more. Below about 50, chance alone produces big swings.

What does the MAD rating mean?

Nigrini’s bands for first digits: close (≤ 0.006), acceptable (≤ 0.012), marginal (≤ 0.015) and nonconformity (above).

Do decimals and negatives work?

Yes. 0.0372 leads with 3, and −250 leads with 2. Zeros are skipped.

Who discovered it?

Simon Newcomb noticed it in 1881 from worn logarithm tables; Frank Benford tested it on 20,000 numbers in 1938.

Is it used in court?

Benford analysis has been used to support fraud investigations, but as a pointer to evidence, not as evidence on its own.

Does it apply to election results?

Often not: vote counts in similar-sized districts don’t span enough orders of magnitude. Claims of fraud based on it alone are unreliable.

Is there a second-digit law?

Yes. Second digits follow a much flatter pattern, from 12% for 0 down to 8.5% for 9.

Sources

  • F. Benford, "The law of anomalous numbers", Proceedings of the American Philosophical Society 78 (1938), JSTOR 984802.
  • M. J. Nigrini, Benford's Law: Applications for Forensic Accounting, Auditing, and Fraud Detection (Wiley, 2012), chapter 7: conformity tests.

Related Tools