Benford's Law Calculator

Paste a dataset and see how its first-digit distribution compares to Benford's Law, P(d)=log₁₀(1+1/d), with a chi-square goodness-of-fit test.

Quick Facts

Method
First-digit frequencies vs. Benford P(d)=log₁₀(1+1/d), tested with a chi-square goodness-of-fit statistic (8 df).
Digit 1 leads about 30.1% of the time; digit 9 only about 4.6%. Critical value at α=0.05 is 15.51.

Your Results

Calculated
Values analyzed
-
Numbers with a valid leading digit
Chi-square (8 df)
-
Goodness-of-fit statistic
Largest deviation
-
Digit furthest from Benford
Verdict
-
At α=0.05, crit. 15.51

Ready

Paste a dataset and run the analysis.

What Benford's Law says

Benford's Law (also called the first-digit law or the Newcomb–Benford Law) describes how often each digit 1 through 9 appears as the leading digit in many real-world collections of numbers. Counterintuitively, the leading digit is not uniform: instead of each digit appearing about 11% of the time, the number 1 leads roughly 30% of the time, and each successive digit is progressively less likely. The exact probability that the leading digit equals d is:

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

The expected first-digit distribution

Plugging every digit into the formula gives the benchmark this calculator compares your data against:

Leading digit dP(d) = log₁₀(1 + 1/d)
130.1%
217.6%
312.5%
49.7%
57.9%
66.7%
75.8%
85.1%
94.6%

These nine probabilities sum to 1, because log₁₀(2/1) + log₁₀(3/2) + … + log₁₀(10/9) telescopes to log₁₀(10) = 1.

Why does data follow this pattern?

Benford's Law tends to hold when data spans several orders of magnitude and is not artificially bounded — think populations of towns, river lengths, stock prices, street addresses, or accounting entries. The intuition is scale invariance: if a quantity is just as likely to sit anywhere on a logarithmic scale, then the span from 1 to 2 (a doubling) covers far more of that scale than the span from 8 to 9 (a ~12% increase), so small leading digits are simply more common. Any distribution that is genuinely scale-invariant must follow Benford's Law exactly.

How this calculator tests your data

The tool reads every number you paste, extracts each value's first non-zero digit (ignoring signs, currency symbols, decimal points, and thousands separators), and tallies how often digits 1–9 appear. It then computes the expected count for each digit as N × log₁₀(1 + 1/d) and runs a chi-square goodness-of-fit test:

χ² = Σ (Observedₖ − Expectedₖ)² / Expectedₖ

With nine categories the test has 8 degrees of freedom. If χ² is at or below the critical value of 15.51 (α = 0.05), the data is statistically consistent with Benford's Law; a larger χ² signals a significant departure worth investigating.

Where it is used

Benford's Law is a standard first-pass screen in forensic accounting and auditing (fabricated invoices and expense reports often over-represent certain leading digits), tax-fraud detection, election-forensics research, and scientific data-integrity checks. It flags anomalies rather than proving fraud — a failing test is a prompt to look closer, not a verdict.

Frequently Asked Questions

What is the exact formula for Benford's Law?
The probability that a number's leading digit equals d is P(d) = log₁₀(1 + 1/d), evaluated for d = 1 through 9. That gives 30.1% for a leading 1, decreasing to just 4.6% for a leading 9. The nine probabilities sum to exactly 1.
Does a failed test prove fraud or manipulation?
No. A significant deviation only means the leading-digit pattern is unusual, which is a reason to investigate further. Many legitimate datasets don't follow Benford's Law — for example, data with a narrow range (adult heights in cm), assigned numbers (ZIP codes, phone numbers), or values clustered near a threshold. Conversely, sophisticated fabrication can be crafted to pass the test.
What kind of data should follow Benford's Law?
Data that spans several orders of magnitude and arises from multiplicative or naturally growing processes: financial transactions, populations, physical constants, invoice amounts, file sizes, and stock prices. Data that is bounded to a narrow range, rounded, capped, or made up of assigned identifiers usually will not.
How many data points do I need?
The chi-square test becomes reliable when each expected digit count is at least about 5. Because digit 9 is expected only 4.6% of the time, you generally want at least ~100–150 values, and ideally several hundred or more, before reading much into the result. With very small samples the test has little power to detect real deviations.