Build and check EAN-13, UPC-A and EAN-8 numbers with the GS1 check digit worked out term by term. The bars are drawn here as an inline SVG rather than fetched from an outside service, and the prefix is looked up so you know which GS1 office issued it.
Barcode Generator - EAN-13, UPC-A and EAN-8 Codes
Build and check EAN-13, UPC-A and EAN-8 numbers with the GS1 check digit worked out term by term. The bars are drawn here as an inline SVG rather than fetched from an outside service, and the prefix is looked up so you know which GS1 office issued it.
Parameters
Enter data for calculations
💡 Fill in all required fields to unlock the calculate button
The problem: a barcode is not a picture of some numbers
Three formats, one arithmetic. EAN-13 for retail almost everywhere, UPC-A for the United States and Canada, EAN-8 for packaging too small to fit the other two. This tool builds all three from scratch, checks numbers you already have, and tells you which GS1 member organisation issued the prefix.
The solution, and its one honest limit
Which format do you actually need
| If you are | Pick | Digits | Because |
|---|---|---|---|
| Selling retail in Europe, Asia, Australia | EAN-13 | 13 | The default GTIN everywhere outside North America |
| Selling retail in the US or Canada | UPC-A | 12 | What North American tills expect on the shelf |
| Labelling something too small for 13 digits | EAN-8 | 8 | Half the width, and GS1 issues it only when space forces it |
| Publishing a book | EAN-13 | 13 | An ISBN barcode is an EAN-13 starting 978 or 979 |
| Numbering stock that never leaves your shop | EAN-13 | 13 | Use prefix 20 to 29, reserved so it can never clash outside your walls |
Working the tool, in order
- Symbology - decide from the table above. It also sets how many digits everything else expects, so change it first rather than last.
- Mode - Random for a throwaway that scans. From a GS1 prefix when the first few digits have to be a particular range. Validate when you already have a number and want to know if it survives a scanner.
- GS1 prefix - digits only, and shorter than the base. An EAN-13 base is 12 digits, so the prefix can run to 11, though in practice you enter the two to seven you were issued.
- Code to validate - paste it with spaces or hyphens if that is how you have it; everything but the digits is stripped before checking.
- Read the arithmetic - the details output prints each digit with the weight it was multiplied by, the running total, and how that total becomes the check digit. If a supplier disputes your number, that is the paragraph to send them.
Five situations this settles
Quick reference
| Format | Total digits | Base | Modules | Quiet zone | First weight |
|---|---|---|---|---|---|
| EAN-13 | 13 | 12 | 95 | 11 left, 7 right | 1 |
| UPC-A | 12 | 11 | 95 | 9 each side | 3 |
| EAN-8 | 8 | 7 | 67 | 7 each side | 3 |
That last column is where most home-made check digit routines go wrong. The weights alternate 3 and 1 counting from the check digit backwards, not from the left. A 12-digit base therefore starts on 1 and a 7-digit or 11-digit base starts on 3. Write the loop from the left with a fixed starting weight and it will be right for EAN-13 and wrong for the other two, which is a pleasant kind of bug because it passes your first test and fails in production.
| Prefix | Issued by | Prefix | Issued by |
|---|---|---|---|
| 000-019, 030-039, 060-139 | United States | 590 | Poland |
| 020-029, 040-049, 200-299 | Restricted circulation (050-059 is coupons) | 690-699 | China |
| 300-379 | France and Monaco | 754-755 | Canada |
| 400-440 | Germany | 840-849 | Spain |
| 500-509 | United Kingdom | 977 | Serial publications, ISSN |
| 520-521 | Greece | 978-979 | Books, ISBN and ISMN |
The tool knows a wider list than this and reports it for any code you generate or check. What no tool can tell you is where a thing was manufactured: a prefix records which GS1 office sold the number to which company. A German company can licence a 400 prefix and have the goods made anywhere in the world.
What people get stuck on
Related tools
Lorem Ipsum Generator
The product copy for the same mockup this barcode is going on - Open the generator
Palindrome Generator
Also checks a string against a rule, except the rule there is symmetry rather than a weighted sum - Open the generator
Anagram Generator
Counts how many orderings a set of letters allows - Open the generator
Random Number Generator
Draws the digits, without wrapping them in a check digit - Open the generator
Password Generator
For the staging login on the shop you are mocking up - Open the generator