Search for a tool
Benford's Law

Tool to verify the Benford's law. Test digital data whether they are random or not and if numbers follow Benford's law. This test is used in particular for the detection of fraud, such as accounting or finance.

Results

Benford's Law -

Tag(s) : Statistics, Data processing

Share dCode and you

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

Team dCode likes feedback and relevant comments; to get an answer give an email (not published). It is thanks to you that dCode has the best Benford's Law tool. Thank you.

# Benford's Law

## Benford Law Numerical Data Analyzer

Tool to verify the Benford's law. Test digital data whether they are random or not and if numbers follow Benford's law. This test is used in particular for the detection of fraud, such as accounting or finance.

### What is the definition of the Benford's Law?

Benford's law states that in the majority of natural collections of numbers (ie. lists of numbers derived from reality and not created artificially), the first significant digit is usually small. This law applies very well to numbers representing orders of magnitude: prices, populations, lengths, etc.

The digit 0 is excluded because it is not significant. The law therefore applies to numbers between 1 and 9.

Mathematically the probability that a digit is the first significant digit of a number in a collection of numbers can be described by the formula:

$$P(d)=\log_{10} \left(1+\frac{1}{d}\right)$$

The corresponding percentages are:

xP(x)
10.301 (30.1%)
20.176 (17.6%)
30.125 (12.5%)
40.097 (9.7%)
50.079 (7.9%)
60.067 (6.7%)
70.058 (5.8%)
80.051 (5.1%)
90.046 (4.6%)

A priori, any distribution of digits too much away from these numbers is not natural, thus abnormal.

### How to test a dataset with Benford's Law?

dCode uses the Chi2 test (χ²). Enter the data in the text box, dCode will calculate the frequency of occurrence of the first significant digits.

dCode considers that the data are correlated with the distribution of Benford's law, when the p-value is less than 0.05 (95% test).

### When to use Benford's law?

Bendord's law is used to check whether data obeying this law have not been artificially modified. Its main use is therefore for audits in the event of suspicion of fraud, generally in accounting or finance.

### What kind of data generally obeys to Benford's law?

Data obeying the Benford law :

- The numbers resulting from transactions, accounting data: turnover, refunds, sales, etc.

- Results of addition, multiplication or exponentiation

Example: Fibonacci numbers, powers, factorials, etc.

### What kind of data does not obey to Benford's law?

Data not obeying the Benford law:

- Sequential numbers: street numbers, invoices, etc.

- Significant numbers, ie. numbers that contents is defined by a nomenclature (for example: card number), or whose value is defined by human thinking (for example: a price of \$ 9.99)

- Numbers coming from a collection limited by a minimum or a maximum or another criterion that can introduce a statistical bias.

## Source code

dCode retains ownership of the source code of the script Benford's Law online. Except explicit open source licence (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, Matlab, etc.) which dCode owns rights will not be released for free. To download the online Benford's Law script for offline use on PC, iPhone or Android, ask for price quote on contact page !