EAN-13 barcode generator

Paste one product number per line to get EAN-13 barcodes as SVG or PNG files or a print sheet. The generator below is set to EAN-13 and opens with four sample numbers from the in-store range that starts with 2, so you can see the result before you paste your own list.

Or build a numbered sequence

What goes into an EAN-13 number

An EAN-13 barcode carries a 13-digit GTIN (Global Trade Item Number). The first 12 digits identify the product and the 13th is a check digit calculated from them. The generator accepts either form: type 12 digits and it adds the check digit, type 13 and it verifies the one you typed.

DigitsWhat they areWho sets them
First 3The GS1 prefix: which GS1 office issued the company prefix, or a special range such as booksGS1
The next fewThe rest of the company prefix, licensed to one companyThe local GS1 office
The rest, up to the 12thThe item reference: one per product variantThe company
13thCheck digitCalculated

Company prefixes come in different lengths. Whatever is left between the prefix and the check digit belongs to the company to number its products, so a company with a 7-digit prefix has 5 digits, room for 100,000 products, and one with an 11-digit prefix has 1 digit, room for 10.

The check digit, worked through

The number below is made up and starts with 27, inside the 20 to 29 range that GS1 keeps for numbers used within one company or region. Its first 12 digits are 271828182845. Counting from the right, the digits get weights of 3 and 1 in turn:

Position123456789101112
Digit271828182845
Weight131313131313
Product221124224124224415

The products add up to 144. The next multiple of 10 is 150, so the check digit is 6 and the full number is 2718281828456. Paste 271828182845 into the generator and the barcode reads 2718281828456.

The check digit catches any single wrong digit. It also catches most swaps of two neighbouring digits, but not all of them. Swap the last two digits of the body to get 271828182854 and the check digit becomes 8, so the mistake shows. Swap the first two to get 721828182845 and the check digit is still 6, because 2 and 7 differ by 5 and a swap of two such digits leaves the total unchanged in its last digit. A check digit proves the digits are consistent. It does not prove they are the right ones.

What the generator does with a wrong check digit

Type all 13 digits and the generator recalculates the check digit from the first 12. If yours differs, the line is not drawn. It appears in red with a note such as wrong check digit (expected 3), the status line counts it as skipped, and it is left out of the ZIP files and the print sheet. The other lines in the batch are still made.

Do not simply replace the last digit with the expected one. The expected digit is worked out from the first 12 digits as you typed them, so if the real mistake is earlier in the number, the fix gives you a valid barcode for the wrong product. In the example above, 2718281828465 has its last two digits swapped. The generator says it expected 3, and 2718281828463 would scan without complaint, but it is not the number on the product. Go back to the packaging, the supplier's file or the GS1 record instead.

There is a second trap that runs the other way. A line with 12 digits is treated as a body and gets a fresh check digit, with no warning. If your list already contains full 13-digit numbers and one of them lost a digit when it was copied, that line turns into a valid barcode for a different number. Check that every line has 13 digits before you generate. In a spreadsheet, =LEN(A2) shows the length of each value; the Excel and Google Sheets guide covers this and the lost-leading-zero problem.

GS1 prefixes: what the first digits tell you

The first digits show which GS1 office issued the company prefix. They do not show where the product was made, because a company can make its goods anywhere. A few common prefixes and special ranges:

PrefixIssued by or used for
001 to 019, 030 to 039, 060 to 139GS1 US
020 to 029 and 200 to 299Restricted circulation numbers within a geographic region, for example in-store items
040 to 049Restricted circulation numbers within a company
300 to 379GS1 France
400 to 440GS1 Germany
450 to 459 and 490 to 499GS1 Japan
500 to 509GS1 UK
539GS1 Ireland
690 to 699GS1 China
754 to 755GS1 Canada
930 to 939GS1 Australia
977Serial publications (ISSN)
978 and 979Books (ISBN); 979-0 is used for printed music

Numbers that start with 0 are almost always UPC-A numbers written with 13 digits. A 13-digit number such as 0012345678905 draws the same bars as the 12-digit UPC-A 012345678905; the UPC barcode generator page explains why.

Books and magazines: ISBN 978 and 979, ISSN 977

An ISBN-13 is already an EAN-13 number that starts with 978 or 979, so the generator draws it like any other. ISBNs come from the national ISBN agency, not from GS1: in the UK and Ireland that is Nielsen, and in the US it is Bowker.

To turn an old 10-digit ISBN into its 13-digit form, put 978 in front, drop the old check digit and calculate a new one. For the made-up ISBN-10 1-901234-56-8, take 190123456, add 978 to get 978190123456 and paste that: the generator adds a 5, giving 9781901234565. Numbers that start with 979 have no 10-digit form.

Magazines and other serials use an ISSN, issued by a national ISSN centre (the British Library in the UK). Its EAN-13 form is 977, then the first 7 digits of the ISSN without its own check digit, then two digits that are usually 00, then the EAN check digit. The ISSN 1234-5679 becomes the body 977123456700, and the generator completes it as 9771234567003.

Book and magazine barcodes often carry a small add-on of 2 or 5 digits to the right of the main symbol, used for things such as a price or an issue number. This generator draws the main EAN-13 symbol only, without add-ons.

Before you print a retail batch

  • Use numbers licensed to your company. A correct check digit does not make a number yours. How to get barcodes for products explains where retail numbers come from.
  • Keep the size within the retail range. A bar width of 2 px is about 160% of the GS1 nominal size, which is inside the allowed range; how to print barcode labels that scan has the details.
  • Leave white space on the left. EAN-13 needs a wider quiet zone on the left than on the right, so do not let text or a border crowd that side.

Frequently asked questions

Do I type 12 or 13 digits?

Either. With 12 digits the generator calculates and adds the check digit. With 13 it checks your last digit and marks the line in red if it does not match.

Why does a line say wrong check digit?

The 13th digit does not match the first 12. Usually one digit was mistyped or two were swapped. Check the number against its source rather than copying in the expected digit from the note.

Can I make an EAN-13 for a number I made up?

For use inside your own business, use a number from the range that starts with 2 and ask your till supplier which part of it to use. Products sold in shops or on marketplaces need numbers licensed to you by GS1.

Can it make the 2-digit or 5-digit add-on?

No. It draws the main EAN-13 symbol only. If a book or magazine barcode needs an add-on, use software that supports EAN add-ons.

Is EAN-13 the same as a GTIN?

GTIN is the number and EAN-13 is the barcode that carries it. A 13-digit GTIN is printed as an EAN-13 barcode.

Back to the tool