The Benford's law calculator above gives the expected frequency of each leading digit under the law, counts the leading digits in a dataset you paste in, and runs a chi-square goodness-of-fit test comparing the two. It reports the statistic, the p-value, the mean absolute deviation and a digit-by-digit breakdown, so the result can be interpreted rather than merely accepted.
Arb Digital publishes it because Benford's law is one of the most misapplied results in applied statistics. The distribution itself is uncontroversial and easy to compute. What the number means when a dataset fails the test is a different question, and the answer is very often nothing at all — which is the part most treatments of the subject leave out.
What This Benford's Law Calculator Does
It extracts the first significant digit from each value in your data, ignoring signs, currency symbols, decimal points and leading zeros, and tallies how many times each of the nine possible digits appears. It computes the expected count for each digit under Benford's law, forms the chi-square statistic from the differences, and converts that into a p-value on eight degrees of freedom.
It also reports the mean absolute deviation, an alternative measure that averages the gap between observed and expected proportions across the nine digits. Unlike the chi-square statistic, this figure does not grow with sample size, which makes it easier to compare across datasets of different sizes but leaves it without any formal test attached.
The bars show each digit's observed share against its expected share, which is usually more informative than either summary number. A dataset can produce a modest chi-square while having one digit badly out of place, and the bars make that visible immediately. For general goodness-of-fit work on other distributions, our chi-square calculator is the direct tool, and our p-value calculator converts a statistic into a probability for any degrees of freedom.
How to Use It
- Paste your numbers into the box, separated by commas, spaces or new lines.
- Choose a significance level. The published critical value for eight degrees of freedom is shown beside each.
- Read the chi-square statistic and compare it against that critical value, or read the p-value directly.
- Look at the bars to find which specific digits are over- or under-represented rather than relying on the summary alone.
- Try the sample datasets to see one that conforms and one that cannot, which is the fastest way to calibrate what the numbers mean.
The Formula and How It Is Calculated
Benford's law states that the probability of a leading digit d is log10(1 + 1/d). That gives 30.10 percent for 1, 17.61 for 2, 12.49 for 3, 9.69 for 4, 7.92 for 5, 6.69 for 6, 5.80 for 7, 5.12 for 8 and 4.58 for 9. Wolfram MathWorld's page on Benford's law gives the same logarithmic distribution and reviews the work explaining why samples drawn from many different distributions converge on it.
The chi-square goodness-of-fit statistic sums, over the nine digits, the squared difference between observed and expected counts divided by the expected count. NIST's engineering statistics handbook sets out the general form of the chi-square goodness-of-fit test, including the requirement that expected counts in each bin be large enough for the approximation to hold.
Take the default dataset, the first forty powers of two. Their leading digits fall as twelve ones, eight twos, four threes, four fours, four fives, four sixes, no sevens, four eights and no nines. The expected count for digit 1 is 40 × 0.30103 = 12.04, and the observed count is 12, so that term contributes almost nothing. Summed across all nine digits the statistic comes to 7.22, which against the critical value of 15.507 at the five percent level gives no reason to reject conformity. The p-value is 0.51.
Degrees of freedom are eight rather than nine because the nine counts must sum to the sample size, so once eight of them are known the ninth is fixed. The p-value here is computed exactly using the closed form available for even degrees of freedom, rather than by interpolating a table.
When Benford's Law Applies, and When It Does Not
The law is not a general property of numbers. It emerges when data spans several orders of magnitude, arises from a multiplicative or growth process, and is not constrained by any rule that shapes its digits. Populations of towns, river lengths, stock prices, invoice totals and physical constants tend to fit. So do the powers of two and the Fibonacci sequence, which is why both are used as demonstrations.
Several common types of data cannot fit, and it is not a defect when they do not. Assigned numbers — invoice references, telephone numbers, postcodes, employee identifiers — have no underlying magnitude at all. Bounded data has its digits determined by the bounds: adult heights in centimetres nearly all start with 1. Data with a strong central tendency and a narrow spread, such as examination scores or shoe sizes, has no room to spread across orders of magnitude. Try the uniform sample button above and watch the statistic explode; that dataset is entirely honest and entirely non-conforming.
Sample size matters in both directions. Below roughly a hundred values the test has little power and will pass almost anything. Above several thousand it becomes so sensitive that trivially small deviations register as significant, because the chi-square statistic scales with the sample size while the deviations do not shrink. That asymmetry is the main reason practitioners report the mean absolute deviation alongside it.
Why a Failed Test Is Not Evidence of Fraud
Benford's law is genuinely used in auditing, and it genuinely finds things. What it finds is a reason to look more closely, not a conclusion. The logic only runs one way: fabricated figures often deviate from Benford, because people inventing numbers avoid patterns they think look suspicious. Deviation does not run back the other way, because far more datasets deviate for innocent reasons than for dishonest ones.
The practical consequence is a base-rate problem. In any large collection of business data, the honest non-conforming datasets vastly outnumber the fraudulent ones, so most failures of the test are false alarms. Treating a failed test as a finding rather than as a prompt produces accusations that do not survive contact with an explanation. Real audit practice uses digit analysis to prioritise which accounts get examined, never as evidence in itself.
There is a second, subtler trap. Applying the test to many subsets of a dataset and reporting the ones that fail is a multiple-comparisons error: at the five percent level, one subset in twenty will fail by chance alone. If you intend to test many groups, our z-score calculator and normal distribution calculator are useful for thinking about how often extremes arise naturally.
Reading the Digit Bars Rather Than the Summary
The chi-square statistic compresses nine comparisons into one number, and compression loses information. Two datasets with the same statistic can be wrong in completely different ways: one with every digit slightly off, another with eight digits perfect and one badly inflated. Only the second pattern is interesting, and only the bars reveal it.
Certain patterns recur often enough to be worth recognising. An excess of low digits beyond what Benford predicts often points to rounding down or to a threshold effect. A spike at a single digit frequently indicates a value repeated many times, such as a default amount or an approval limit. A distribution that is too flat suggests numbers generated uniformly rather than arising from a process. None of these is proof of anything, but each suggests a specific thing to check.
To examine the shape of your data more generally, our frequency distribution calculator and histogram calculator group values into bins, and the mean, median and mode calculator covers the summary statistics that tell you whether the data spans enough orders of magnitude for Benford to apply at all.
Arb Digital reads analytics and business data with the assumptions and base rates stated, not buried.
Browse All Free Tools Talk To Our TeamCommon Mistakes to Avoid
- Treating a failed test as evidence of fraud — far more honest datasets deviate than dishonest ones, so most failures are false alarms.
- Applying it to assigned or bounded numbers — reference codes and constrained measurements have no reason to follow the law and never will.
- Testing too few values — below about a hundred numbers the test has almost no power and will pass nearly anything.
- Testing very large samples uncritically — the statistic grows with sample size, so negligible deviations become statistically significant.
- Reading only the summary statistic — a single misbehaving digit and nine slightly-off digits can produce the same chi-square and mean very different things.
Related Free Tools From Arb Digital
Run a general goodness-of-fit test with the chi-square calculator, convert a statistic into a probability with the p-value calculator, bin your data with the frequency distribution calculator or the histogram calculator, and summarise it with the mean, median and mode calculator. The full free online tools hub lists every statistics tool we publish.
Frequently Asked Questions
The probability that the first significant digit is d equals the base-ten logarithm of one plus one over d. That gives about 30.1 percent for the digit 1 and about 4.6 percent for the digit 9.
Data that spans several orders of magnitude and arises from a multiplicative or growth process, such as populations, prices, invoice totals and physical measurements. Assigned or bounded numbers do not.
No. Many honest datasets deviate for structural reasons, and they far outnumber fraudulent ones. A failed test is a prompt to investigate, never a finding in itself.
There are nine digit categories, but their counts must add up to the sample size. Once eight are known the ninth is fixed, so only eight are free to vary.
Below about a hundred the test has very little power. Above a few thousand it becomes so sensitive that trivial deviations register as significant, which is why the mean absolute deviation is often reported alongside it.
The average gap between observed and expected proportions across the nine digits. It does not grow with sample size, so it compares across datasets, but no formal significance test attaches to it.
Because repeated multiplication spreads the values evenly across the logarithmic scale, which is exactly the condition Benford's law describes. The Fibonacci sequence conforms for the same reason.
Second-digit and digit-pair tests exist and are used in auditing, but their expected distributions are flatter and harder to interpret. This page covers the first-digit test only.
This page performs a published statistical test for educational purposes. A result from it is not evidence of misconduct and should not be presented as such.