Benford Audit

Benford's-law testing for people who review other people's numbers

You have a year of expense claims, a vendor payment history or a general-ledger export, and too many rows to read. You want to know which handful to pull first. Benford's law gives a principled place to start: in most honest financial data, about 30% of amounts begin with a 1 and under 5% begin with a 9, and invented or manipulated figures tend not to follow that pattern.

Run the tests on your CSV

Who it is for

What it runs

The tests and their verdict bands follow Mark Nigrini's Benford's Law: Applications for Forensic Accounting, Auditing, and Fraud Detection (Wiley, 2012):

Two additions that are not in the standard suite:

A worked example

The page's example button loads a made-up expense ledger: 2,400 amounts drawn from a distribution that follows Benford's law, spread over 40 vendors, plus three planted problems. A vendor with 60 invoices between 4,500 and 4,999 under a 5,000 approval limit; 25 copies of the same 1,250.00 reimbursement; and an employee whose 80 claims were made up by hand, mostly starting with 5 to 8. Here is what the tests report on it.

TestResultWhat it found
First digit, whole fileMAD 0.0031, close conformityNothing. 165 bad rows in 2,565 barely move the whole-file first digit.
First two digits, whole fileMAD 0.0019, marginally acceptableA hint something is off, without saying what.
Just under 5,00084 under vs 30 over; 59.9 expected under; p = 2.9 × 10-6The limit-shaving vendor.
Just under 10,00025 under vs 37 over; p = 0.98Nothing, correctly.
Number duplication1,250.00 appears 25 timesThe repeated reimbursement.
Per-group ranking (39 groups of 50+)2 groups with q < 0.05Exactly the shaving vendor and the invented-claims employee; no honest vendor passes the correction.
Last two digitschi-square 281.7 on 99 dfToo many .00, .25 and .50 endings: rounding from the repeated and invented amounts.

The lesson is the usual one in Benford work: the whole-file first-digit test is a blunt instrument. The tests that look at a specific mechanism (a limit, a repeat, one person's numbers) are the ones that point to records.

When to use something else

Privacy

The CSV is read by the page in your browser and is never uploaded. A command-line version reads the same files with the same code (node cli.mjs ledger.csv --threshold 5000,10000) for anyone who would rather keep the data off a browser entirely or script the check.