Skip to content

Serial number randomisation calculator

Enter the length of your serial number, its character set and the quantity you will issue per product code; see the guess probability, the entropy and the chance of a repeat under random generation, and compare with the 1-in-10,000 threshold of EU 2016/161. The calculation runs in your browser.

Free tool · Serialisation

Total number of characters (at most 20 for GS1 AI 21).

Enter it yourself when Custom is selected; it shrinks if you exclude look-alike characters.

The non-random part (e.g. a fixed letter prefix); it adds nothing to the possible space.

The quantity you will issue for one GTIN, per batch or over its lifetime; confirm which one applies from the relevant guidance.

Shortest length that meets the threshold

By character set, the shortest serial number length that brings the guess probability for the entered quantity below 1 in 10,000
Character setSizeRandom partTotal (incl. fixed prefix)
10 · digits101111
26 · letters2688
36 · uppercase + digits3677
62 · upper/lower case + digits6266
82 · GS1 CSET 828266

The random part is the smallest number of characters for which the possible space is more than 10,000 times the quantity.

Possible serial numbers
4.74E18
Entropy (random part)
62 bits
Guess probability (quantity / possible space)
1,000,000 / 4.74E18 = 2.11E-13
Threshold (EU 2016/161, Article 4(b))
< 1 / 10,000
Assessment
Below the threshold (less than 1 in 10,000)
Probability of at least one repeat under random generation
1.06E-7

Very low; still check for duplicates.

Why sequential numbering does not comply

With sequential numbers (e.g. 100001, 100002…) the possible space effectively collapses into a single sequence: whoever knows one number knows the next. From an attacker's view the share of valid numbers is not quantity/space as in the calculation but close to 1, so sequential numbering cannot meet the 1-in-10,000 threshold. Numbers must be generated randomly (or by an unpredictable algorithm).

For Turkey's ITS, its own rules for the serial number (character set, length, format) may also apply: for these values consult the current ITS technical guide.

This calculation is a preliminary assessment and not legal or technical advice. For a compliance decision, consult the relevant legislation and the guidance of the competent authority. The calculation runs in your browser; the values are not sent to any server.

Shall we review your serial number generation method and duplicate checking together? Let's talk about your current system.

Request a call

01

How to use it

  1. A

    Choose the serial number length and character set; enter the length of the fixed (non-random) prefix, if any.

  2. B

    Enter the number of serial numbers you will issue for one product code, per batch or over its lifetime.

  3. C

    Review the guess probability, the position against the 1-in-10,000 threshold, the entropy, the collision probability and the table of shortest lengths.

02

How is the guess probability calculated?

If the random part of the serial number consists of n characters drawn from a set of k, the number of possible serial numbers is N = k^n. If a numbers are issued for one product code, the probability that a randomly chosen number is valid is p = a / N. A fixed prefix adds nothing to the space; only the number of random characters, n, counts.

Commission Delegated Regulation (EU) 2016/161, Article 4(b), requires the probability of guessing a serial number to be negligible and in any case lower than one in ten thousand. The tool compares p with this threshold, also shows the entropy of the random part (n · log2 k bits) and lists the shortest length that meets the threshold for each character set.

03

Sequential numbering and predictability

Sequential numbers are attractive because they make production order easy to follow, but the value of serialisation against counterfeiting rests on numbers being unpredictable. In a sequential run, anyone who sees one number can derive its neighbours; the chance of finding a valid number is far above the threshold.

The practical solution is to generate numbers randomly (or by an unpredictable algorithm) and keep the production order in a separate record. Random generation needs an even distribution of characters and a check for repeats.

04

Collision (birthday) probability and duplicate checking

When numbers are generated randomly, the chance that two of them are the same is higher than intuition suggests (the birthday paradox). For a numbers and N possible values, the probability of at least one repeat is approximately 1 − exp(−a² / 2N). The value the tool shows is this approximation.

Two products with the same product code must never receive the same serial number, so even when the probability is very low, production should check for duplicates (record the numbers generated and compare each new one against them). The low/medium/high split is the tool's own indicator, not a regulatory value.

FAQ

Are the values I enter sent anywhere?
No. The calculation runs entirely in code inside your browser; the values are neither transmitted to a server nor stored.
Where does the 1-in-10,000 threshold come from?
Commission Delegated Regulation (EU) 2016/161, Article 4(b): the probability of guessing a serial number must be negligible and in any case lower than one in ten thousand. Confirm from the relevant guidance which quantity applies in practice.
What quantity should I enter?
The number of serial numbers you will issue for the same product code (GTIN): per batch or over its lifetime. A larger quantity gives a worse probability; entering the long-term total is the safe side.
What are the serial number rules of Turkey's ITS?
This tool gives no ITS-specific value. For the character set, length and format consult the current ITS technical guide.
Does a fixed prefix enlarge the possible space?
No. A fixed prefix makes the number longer but, not being random, does not enlarge the possible space; only the number of random characters counts.

Set up serial number generation correctly

We build unpredictable serial number generation, duplicate checking and reporting to national systems, integrated with your line and ERP. Let's talk in a free discovery call.