How to use the ean-13 barcode generator
- Type the product number: 12 digits to have the check digit added, or all 13 digits to have it verified.
- Pick a module width (the width of the narrowest bar) and a bar height, and choose whether the digits are printed below the bars.
- Read the check digit, GS1 prefix and parity pattern in the result table.
- Download or copy the SVG and place it on your label or packaging file at its natural size or larger.
How the EAN-13 check digit works
The thirteenth digit is a check digit calculated from the first twelve. Number the digits 1 to 12 from the left, multiply digits in odd positions by 1 and digits in even positions by 3, add everything, and take the amount needed to reach the next multiple of 10.
For 590123412345: odd positions give 5 + 0 + 2 + 4 + 2 + 4 = 17, even positions give 9 + 1 + 3 + 1 + 3 + 5 = 22 and 22 x 3 = 66. The total is 83, so the check digit is 10 - 3 = 7 and the full number is 5901234123457.
If you enter 13 digits and the last one does not match, this ean-13 barcode generator refuses to draw the symbol and tells you which digit it expected. That catches the most common data entry mistakes before a label is printed.
L, G and R encoding and the first digit
Every digit becomes a 7-module pattern of bars and spaces. Three alphabets exist: L (odd parity: each digit has an odd number of dark modules), G (even parity: an even number, the mirror image of R) and R (the complement of L, used on the right half). The first digit of the number is not drawn as bars. It selects which of L or G is used for each of the six left-hand digits:
| First digit | Left pattern | First digit | Left pattern |
|---|---|---|---|
| 0 | LLLLLL | 5 | LGGLLG |
| 1 | LLGLGG | 6 | LGGGLL |
| 2 | LLGGLG | 7 | LGLGLG |
| 3 | LLGGGL | 8 | LGLGGL |
| 4 | LGLLGG | 9 | LGGLGL |
A first digit of 0 uses only L patterns, which is why a UPC-A code is identical to an EAN-13 code with a leading zero.
Structure of the symbol: 95 modules
An EAN-13 symbol is exactly 95 modules wide: a start guard 101 (3 modules), six left digits (42), a centre guard 01010 (5), six right digits (42) and an end guard 101 (3). The module pattern row in the result shows this string with 1 for a bar and 0 for a space.
The symbol also needs quiet zones, blank margins that let a scanner find the edges. GS1 specifies at least 11 modules on the left and 7 modules on the right, and this tool adds both. With a module width of 3 px that is 33 px and 21 px of margin around a 285 px symbol. The first digit sits in the left quiet zone and the guard bars extend below the others, as on retail packaging.
What the GS1 prefix tells you
The first two to three digits are a GS1 prefix. It identifies the GS1 member organisation that issued the company prefix, not the country where the product was made. A product with prefix 400 to 440 was numbered through GS1 Germany, whatever factory produced it.
| Prefix | Allocated to |
|---|---|
| 000 to 139 | United States and Canada |
| 300 to 379 | France and Monaco |
| 400 to 440 | Germany |
| 500 to 509 | United Kingdom |
| 690 to 699 | China |
| 978 and 979 | Books (ISBN, Bookland) |
| 020 to 029, 200 to 299 | Restricted distribution (in-store use) |
Prefixes beginning 02 or 2 are meant for in-store labels such as weighed produce and are not valid for products sold through other retailers. Only a licence from GS1 gives you a company prefix that is unique worldwide.
Sizes, printing and common mistakes
The nominal EAN-13 module is 0.33 mm, giving a symbol about 31.35 mm wide before quiet zones. GS1 allows scaling from 80 percent to 200 percent. In pixels, choose a module width that your printer can reproduce as a whole number of dots: at 300 dpi a 0.33 mm module is about 4 dots.
- Do not stretch the SVG horizontally; the bar width ratios must stay exact.
- Print dark bars on a light background. Red or yellow bars may not scan.
- Keep the quiet zones free of text and borders.
- Do not invent a company prefix. A barcode scans with any digits, but retailers and marketplaces check numbers against the GS1 registry.
Also see the GTIN validator for checking numbers you already have and the EAN-8 generator for small packages.
Worked examples
| Example | Input | Result |
|---|---|---|
| Polish product, 12 digits | Digits (12 or 13): 590123412345; Module width (px): 3; Bar height (px): 100; Show digits below the bars: yes; Background: white | EAN-13 number: 5901234123457; Check digit: 7 (calculated); GS1 prefix: 590: Poland; Left parity pattern: LGGLLG (first digit 5); Module pattern: 10100010110100111011001100100110111101001110101010110011011011001000010101110010011101000100101; Quiet zones: 11 modules left, 7 modules right; Image size: 339 x 127 px |
| German product, 13 digits | Digits (12 or 13): 4006381333931; Module width (px): 3; Bar height (px): 100; Show digits below the bars: yes; Background: white | EAN-13 number: 4006381333931; Check digit: 1 (valid); GS1 prefix: 400: Germany; Left parity pattern: LGLLGG (first digit 4); Module pattern: 10100011010100111010111101111010001001011001101010100001010000101000010111010010000101100110101; Quiet zones: 11 modules left, 7 modules right; Image size: 339 x 127 px |
| Book (ISBN-13) | Digits (12 or 13): 9780201379624; Module width (px): 3; Bar height (px): 100; Show digits below the bars: yes; Background: white | EAN-13 number: 9780201379624; Check digit: 4 (valid); GS1 prefix: 978: Books (ISBN, Bookland); Left parity pattern: LGGLGL (first digit 9); Module pattern: 10101110110001001010011100100110100111001100101010100001010001001110100101000011011001011100101; Quiet zones: 11 modules left, 7 modules right; Image size: 339 x 127 px |
| Small, no text, transparent | Digits (12 or 13): 5901234123457; Module width (px): 2; Bar height (px): 60; Show digits below the bars: no; Background: transparent | EAN-13 number: 5901234123457; Check digit: 7 (valid); GS1 prefix: 590: Poland; Left parity pattern: LGGLLG (first digit 5); Module pattern: 10100010110100111011001100100110111101001110101010110011011011001000010101110010011101000100101; Quiet zones: 11 modules left, 7 modules right; Image size: 226 x 60 px |
FAQ
What is an EAN-13 barcode?
EAN-13 is the 13-digit retail barcode used on products worldwide. It encodes a GTIN-13 number as 95 modules of bars and spaces that scanners read at the checkout.
Can I enter 12 digits instead of 13?
Yes. With 12 digits the tool calculates the check digit with the weight 1 and 3 modulo 10 algorithm and shows it in the result.
What happens if my check digit is wrong?
The tool shows an error and the correct digit for your first twelve digits, so you can fix the number before printing.
Is the generated barcode scannable?
Yes, if printed with enough contrast and at a size of at least 80 percent of nominal. The pattern follows the L, G and R tables of the EAN-13 specification.
Is a barcode made here a valid product number?
The symbol is valid, but the number is only registered to you if it was issued through a GS1 member organisation. Retailers verify numbers against the GS1 registry.
Does this tool upload my data?
No. The barcode is built in your browser and nothing is sent to a server.