Benford's Law Calculator

Benford's Law Calculator

Test whether your dataset follows Benford's Law. Analyze the distribution of first digits and detect anomalies or fraud.

Last updated: March 2026

Enter Your Data

Only positive numbers are used. Zeros and negative numbers are ignored.

✓ Consistent with Benford's Law
χ² = 5.1397
p-value: 1.0000
Valid Numbers
12
χ² Statistic
5.140
DF (Degrees of Freedom)
8

First Digit Distribution

DigitObservedExpected %Expected Count
1330.10%3.61
2117.61%2.11
3112.49%1.50
419.69%1.16
517.92%0.95
616.69%0.80
715.80%0.70
815.12%0.61
924.58%0.55

Expected First-Digit Distribution (Benford's Law)

DigitExpected %Applications Where Benford's Applies
130.1%Financial records, tax returns, election data, population sizes
217.6%Stock prices, scientific constants, street addresses
3-9Decreasing (12-5%)Digit 9 appears least frequently (~4.6%)

Significant deviations (χ² test p < 0.05) may indicate data fabrication, rounding, or quality issues. Not all datasets follow Benford's—typically applies to naturally occurring numbers spanning multiple orders of magnitude.

What is Benford's Law?

Benford's Law is a fascinating statistical principle stating that in many real-world datasets, the leading digit is not uniformly distributed (1/9 each). Instead, smaller digits (especially 1) appear more frequently than larger digits. Specifically, the first digit $d$ follows the distribution: $P(d) = \log_10(1 + 1/d)$.

This means digit 1 appears ~30% of the time, digit 2 appears ~18%, and digit 9 appears only ~5%. The pattern emerges naturally in many datasets: financial records, tax returns, city populations, stock prices, and more. Deviations from Benford's Law can indicate data anomalies, rounding errors, or even fraud.

The law was first noted by Frank Benford in 1938, though it applies to any exponentially growing or multiplicatively scaled data. Fraudsters often don't know about Benford's Law and misrepresent digits uniformly, allowing auditors to detect suspicious patterns.

How to Use This Calculator

1

Paste or Enter Your Numbers

Enter a list of positive numbers separated by commas, spaces, or newlines. Only the first digit of each number is analyzed.

2

Review the Chi-Square Test

The calculator computes a χ² statistic comparing your observed distribution to Benford's expected distribution.

3

Interpret the Result

If p-value < 0.05, your data significantly deviates from Benford's Law—possible indicators of data quality issues or fraud.

Benford's Law Expected Frequencies:

Digit 1: 30.10%
Digit 2: 17.61%
Digit 3: 12.49%
Digit 4: 9.69%
Digit 5: 7.92%
Digit 6: 6.69%
Digit 7: 5.80%
Digit 8: 5.12%
Digit 9: 4.58%

Worked Example

Testing a dataset of 100 invoices from a company's accounting records:

Data:
12 invoices start with digit 1
5 invoices start with digit 2
3 invoices start with digit 3
(and so on...)
Benford's Expected:
Digit 1: 30.1% of 100 = 30.1 expected invoices
Digit 2: 17.6% of 100 = 17.6 expected invoices
Digit 3: 12.5% of 100 = 12.5 expected invoices
Result:
χ² = 2.45, p-value = 0.86 (NOT significant)

The invoices follow Benford's Law well. The observed distribution matches the expected distribution within normal statistical variation. No evidence of fraud or anomalies.

Interpretation: If the p-value were < 0.05 (e.g., χ² > 15.5), we'd suspect data manipulation.

Frequently Asked Questions

Does Benford's Law apply to all datasets?

No. It applies to data that spans multiple orders of magnitude (exponential growth or multiplication): financial data, populations, stock prices, gene lengths. Small datasets or those with constrained ranges (e.g., grades 0–100) don't follow it.

What's the significance of the p-value?

A p-value < 0.05 suggests your data significantly deviates from Benford's Law. This could indicate data entry errors, rounding, artificial constraints, or fraud. Larger p-values mean your data fits well.

Can I use Benford's Law to detect fraud?

Yes, as a screening tool. Fraudsters rarely account for first-digit distributions, so fabricated financial records often deviate. However, it's not proof alone—combine with other audits.

Why does Benford's Law work mathematically?

When numbers are distributed across multiple orders of magnitude and scales (multiplied by random factors), the logarithmic distribution of first digits emerges naturally. It's scale-invariant.

What if I have very few numbers (< 10)?

Results are unreliable. Chi-square tests require sufficient sample size (typically ≥ 20–30). With few numbers, random variation dominates.

Can I apply this to leading zeros or negative numbers?

No. Benford's Law applies only to positive numbers' first significant digit. Leading zeros (e.g., 0.123) have first digit 1 (from 1.23×10⁻¹). Negatives: use absolute value.

What if all my numbers start with digit 5?

That's a huge red flag (χ² would be enormous, p ≈ 0). Suggests data is either fabricated, heavily rounded, or bounded (e.g., prices in a fixed range than expected by Benford's Law).

How do I fix data that deviates from Benford's Law?

Don't 'fix' it artificially. Investigate root causes: rounding, data entry errors, measurement constraints. If it's high-quality real data with constrained ranges, Benford's Law simply doesn't apply.

Related Tools