Math calculator

Benford’s Law Calculator

Do the first digits fit?

Check the digits

Two hundred Fibonacci numbers. Sixty of them lead with a 1 against 60.2 expected, thirty-six with a 2 against 35.2, and the whole table gives chi-square 0.6857 on 8 degrees of freedom — p = 0.99956. MAD is 0.004141, inside Nigrini’s “close conformity” band. The largest per-digit z across all nine digits is 0.4075.

200 values read

MAD = 0.004141 — close

Chi-square is 0.6857 on 8 degrees of freedom, p = 0.99956. The digit furthest from expectation is 8, at 6.00% against 5.12% (z = 0.4075). Chi-square grows with n, so on a large dataset it will reject departures too small to mean anything — which is why MAD is quoted first.

MAD

0.004141

close

Chi-square

0.6857

8 df, p = 0.9996

Largest digit z

0.4075

digit 8

Values used

200

enough to read

Every leading digit

Observed against Benford-expected leading-digit frequencies
DigitCountObservedBenfordDifferencez
160 / 60.230.00%30.10%-0.10pp0.032
236 / 35.218.00%17.61%+0.39pp0.052
325 / 25.012.50%12.49%+0.01pp0.003
418 / 19.49.00%9.69%-0.69pp0.211
517 / 15.88.50%7.92%+0.58pp0.174
612 / 13.46.00%6.69%-0.69pp0.252
711 / 11.65.50%5.80%-0.30pp0.030
812 / 10.26.00%5.12%+0.88pp0.407
99 / 9.24.50%4.58%-0.08pp0.051

Nine z-tests on the same table means roughly one digit in twenty will be flagged by chance alone. A single starred digit is not a finding; a pattern across several is worth a second look.

Nigrini’s conformity bands

Mean absolute deviation thresholds for first-digit conformity
MADReadingThis data
under 0.006close
0.006 to 0.012acceptable
0.012 to 0.015marginal
0.015 and abovenonconformity

MAD is used ahead of the chi-square because it does not grow with the sample size. Chi-square on fifty thousand records rejects conformity that is, in practice, perfect.

Scale invariant Per-digit z tests MAD as well as chi-square A screen, never evidence

What this tool shows

Two hundred Fibonacci numbers: sixty lead with a 1 against 60.2 expected, and the largest deviation across all nine digits is a z of 0.4075. Benford’s law is a statement about log-uniformity, not about accounting — which is why it also flags fifty perfectly innocent human-rounded numbers, where twelve lead with a 5 against 3.96 expected. Both presets are here, and the second is the one that matters.

  • Leading-digit frequencies against log₁₀(1 + 1/d), with counts and expected counts side by side
  • Nigrini’s MAD conformity bands, quoted ahead of the chi-square because MAD does not grow with n
  • A chi-square goodness-of-fit test on 8 degrees of freedom
  • Per-digit z scores with a continuity correction, and a warning about testing nine of them at once
  • A preset where the chi-square fails to reject data that obviously does not conform
  • A preset that fails the law for a reason that has nothing to do with fraud
Scale invariant Per-digit z MAD and chi-square False positives shown

A failed digit test is a reason to look, never a finding.

Updated 13 September 2026 · Works in any browser, no installation

Benford’s law says a leading digit d appears with probability log₁₀(1 + 1/d) — 30.1% of values start with 1 and 4.6% with 9. It holds for data whose logarithms are spread evenly across several orders of magnitude, which covers a great deal of naturally occurring numbers and excludes a great deal more: anything with a fixed range, anything assigned rather than measured, anything heavily rounded. The law is about how numbers grow, not about who wrote them down.

At a glance

Formula shown
P(first digit = d) = log₁₀(1 + 1/d) for d = 1…9, which sums to exactly 1 because the nine terms telescope to log₁₀(10). Conformity is measured two ways: chi-square = Σ(Oᵢ − Eᵢ)²/Eᵢ on 8 degrees of freedom, and Nigrini’s MAD = (1/9)·Σ|observed share − expected share|, which is independent of the sample size and is the one to read first. Per-digit z scores use a continuity correction of 1/(2n), dropped when it would overshoot the gap.
Scenario support
Screening expense claims, invoices or journal entries before a manual review, sanity-checking a scraped or merged dataset for duplication and truncation, auditing scientific figures for rounding artefacts, and testing whether a simulated dataset spans the orders of magnitude it was supposed to.
Educational estimate
Planning support from the values you enter — not professional advice.

The rounded-numbers preset fails, and nothing is wrong with it

Benford screens are sold on their hit rate and almost never on their false-positive rate. The fourth preset is the false-positive rate.

Fifty numbers that a person wrote down rather than measured. Prices, targets, round estimates — the sort of figures that fill a real ledger.

Twelve of them lead with a 5 against 3.96 expected, a z of 3.949. MAD is 0.041315, deep into nonconformity, and the chi-square p is 0.01418.

There is no fraud in that data at all. Human rounding clusters on 5 and 0, and any dataset built from price points or target figures will fail this test for that reason alone.

Which is why a failed digit test is a reason to open the file, never a conclusion. The distinctive thing about fabricated numbers is that people avoid repeating digits and avoid round values — roughly the opposite pattern.

Data that has no business being tested

The law needs the logarithms of the data to sweep evenly across at least a couple of orders of magnitude. Most datasets do not.

Anything with a fixed floor or ceiling. The uniform preset here runs from 100 to 1000 and fails completely, correctly, and uninterestingly.

Anything assigned rather than measured: invoice numbers, postcodes, telephone numbers, product codes. These carry no magnitude at all.

Anything spanning less than an order of magnitude. Adult heights in centimetres are all between about 150 and 200, so almost every value leads with a 1.

And anything with a built-in threshold. Expenses capped at £250 pile up just below the cap, which shifts the digits for a reason that is policy rather than deception.

Chi-square is the wrong test at both ends

The chi-square is the statistic every Benford calculator reports, and it is unreliable in two opposite directions.

At small n it has almost no power. The uniform preset here is as non-conforming as data gets, and on fifty values chi-square returns p = 0.08996 — not significant at 5%.

At large n it rejects everything. Chi-square scales with the sample size, so on fifty thousand records a deviation far too small to matter comes back with a p-value near zero.

MAD is quoted first here because it does neither. It is an average absolute difference in proportions, so it does not grow with n, and Nigrini’s bands are calibrated on that basis.

The bands are still a convention rather than a test. They were derived from audit experience, not from a null distribution, and no threshold survives being applied to a dataset that should never have been tested.

Why the law is true at all

Benford’s law is often presented as a mystery. It follows from one property, and the powers-of-two preset demonstrates it directly.

The leading digit of a number is decided entirely by the fractional part of its logarithm. A value leads with 1 exactly when that fraction lies between 0 and log₁₀2.

So if the fractional parts are spread evenly, the digit frequencies are the widths of those intervals — which is log₁₀(1 + 1/d).

Powers of two advance their logarithm by a constant irrational step, so their fractional parts sweep the unit interval evenly. Two hundred of them give MAD 0.002592 and a chi-square of 0.1811.

This also explains the scale invariance. Multiplying every value by a constant shifts every logarithm by the same amount, which leaves an even spread even. The verification suite asserts conformity survives multiplying the Fibonacci set by six different factors, including 0.5 and 1000.

Nine tests on one table

The per-digit z scores are the most actionable part of the output and the easiest to over-read.

Nine simultaneous tests at 5% will flag about one digit in twenty by chance. A single starred digit in an otherwise clean table is what noise looks like.

A pattern is different. Several adjacent digits pushed the same way, or a single digit at z = 3.9 as in the rounding preset, is worth following.

The continuity correction matters at small n and is applied here, dropped only when it would exceed the gap it is correcting.

And the z scores are not independent of each other, because the nine shares must sum to 1 — which is the same reason the chi-square has 8 degrees of freedom rather than 9.

Reporting a digit test

Four items, and the first is the one that decides whether the rest means anything.

Say why this data should follow the law. Spanning several orders of magnitude, measured rather than assigned, no thresholds — if none of that is true, do not run the test.

Give n, MAD and the chi-square with its p. MAD without n hides nothing, but chi-square without n is uninterpretable in either direction.

Give the digit table, not just the summary. Which digit fails is the whole of the actionable content.

And state what the test is for. “Used to prioritise which accounts to sample manually” is a legitimate use; “shows the figures were manipulated” is not something a digit distribution can support.

Sources and methodology

References for the law, its conformity measures and its limits.

Method. The expected frequencies come from log₁₀(1 + 1/d) evaluated directly, and the suite asserts they total exactly 1 and that the first and ninth match the published 0.30103 and 0.04576. Zeros and non-finite values are discarded rather than counted, and the count of discards is reported instead of being hidden; negative values contribute their magnitude. MAD is reported ahead of the chi-square because it does not scale with n, and the shipped uniform preset shows why — on fifty values the chi-square p is 0.08996 on data that could not conform less. The per-digit z scores carry a 1/(2n) continuity correction, dropped where it would exceed the gap. The suite asserts that conformity survives multiplying every value by 2, 3, 7, 0.5, 13.7 and 1000, which is the scale invariance the law rests on, and that the nine observed shares always total 1 across 150 generated datasets. That engine is verified on every change against 157 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Chi-SquareGoodness of fit and tests of independence with every expected count and per-cell contribution shown — because the validity condition is about expected counts, not observed ones, and most calculators hide them.
Kolmogorov-Smirnov TestKS goodness-of-fit with the Lilliefors correction when parameters are fitted, exact small-sample p-values and a two-sample mode.
Goodness of FitChi-square with per-cell contributions and standardised residuals, plus a measured answer to the “expected at least 5” rule — below the floor the test is CONSERVATIVE (3.27% at 2 per cell), not liberal.
Frequency DistributionA frequency table with relative and cumulative columns, and all six standard bin-count rules computed at once — they disagree by a factor of 6.67 at n = 10,000, where Sturges asks for 15 bins and the square-root rule asks for 100.
Z-ScoreA z-score from your data or from a known mean and SD — with the normal-table percentile checked against the share of your data that actually falls below it, and a warning when they disagree.
Dixon's Q TestDixon's Q outlier test with a simulated p-value rather than a three-row table, all four ratios, and the masking failure shown.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool, not a fraud detector. A dataset can fail this test for reasons that have nothing to do with manipulation — human rounding, price points, caps and thresholds, or a range too narrow for the law to apply — and manipulated data can pass it. Use a digit test to decide where to look, never as evidence of what you find.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Launched first-digit analysis with Nigrini MAD conformity bands quoted ahead of the chi-square, because MAD does not scale with n.
  2. Shipped a uniform preset where MAD reports nonconformity instantly and the chi-square p is 0.08996, which would not reject at 5%.
  3. Shipped a human-rounded preset that fails the law with no fraud present: twelve of fifty lead with a 5 against 3.96 expected.
  4. Added per-digit z scores with a continuity correction and an explicit warning about testing nine of them at once.
  5. Asserted the scale invariance the law rests on by rechecking conformity after multiplying every value by six different factors.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.