Choose language

EAN-13 Barcode Generator

Generate scannable EAN-13 retail barcodes from 12 digits. The check digit is calculated automatically, with PNG and SVG download for product labels.

Mehmet Demiray Published Updated
Share
Barcode GeneratorThe general barcode tool covering retail, logistics and general symbologies, with check digits added automatically and links to format-specific generators.
Enter 12 digits; the 13th check digit is added automatically.
Module width multiplier — larger values produce a wider barcode.
Height of the bars (in millimeters).
Print the digits as readable text under the barcode.

The Retail Standard

EAN-13 is the barcode you see on almost every consumer product sold outside North America, and it is the same thing as a GTIN-13. The 13 digits are not random. The opening digits form a GS1 prefix that is often associated with a country or numbering authority. The next block identifies the company that registered the number. The block after that is the product reference the company assigns to a specific item. The final single digit is a check digit that guards against scanning errors. Read together, those segments give every product a globally unique identifier that point-of-sale systems can look up instantly. Because the structure is fixed and internationally agreed, a barcode generated correctly here will scan in any compliant retail system. The broader Barcode Generator tool covers other symbologies, but for standard retail goods sold at a checkout, EAN-13 is the format you almost always need.

The Check Digit

The thirteenth digit of an EAN-13 code is a checksum that lets a scanner detect most data entry and reading errors. You supply the first 12 digits, and the tool computes the last one for you. The math uses a weighted sum: starting from the right of the 12 digits, alternate positions are multiplied by 3 and 1. Expressed as a formula over the first twelve digits, the check digit is:

c=(10(dodd+3deven)mod10)mod10c = (10 - (\sum d_{odd} + 3\sum d_{even}) \bmod 10) \bmod 10

For example, with the digits 400638133393, the weighted total comes to a value whose remainder determines the final digit. If you ever paste a full 13 digit code, the tool recalculates the check digit and tells you whether the one you entered is valid. This is the same checksum principle used across GS1 retail formats, so the logic carries over to the UPC-A generator for UPC-A codes.

Getting Legitimate Numbers

A barcode that scans is not the same as a barcode you are allowed to sell with. For products that go through retailers or major marketplaces, the EAN-13 number should come from a company prefix that you license through GS1, the organisation that administers the standard. That prefix guarantees your numbers do not collide with anyone else's and that they resolve correctly in global product databases. You can generate a valid, scannable barcode here for any 12 digit input, which is perfect for mock-ups, internal labels, and design proofs. For goods you only sell in your own store and never list elsewhere, some retailers reserve internal-use ranges that you can assign freely. The key distinction is intent: invent a number for testing or private use, but license a real one before you put a product on a shelf you do not control. Bulk runs are handled by the Bulk EAN-13 Barcode Generator tool.

Print Specs and Quiet Zones

An EAN-13 barcode only scans reliably if it is printed at a sensible size with enough clear space around it. The nominal symbol is about 37 millimetres wide and 26 millimetres tall, and the standard allows magnification roughly between 80% and 200% of that size. Shrinking below the lower bound makes the bars too fine for many scanners. Just as important are the quiet zones, the blank margins on the left and right of the bars. Without them a scanner cannot tell where the code begins and ends, so never crop a barcode tight to its edges or place text right against it. Print in solid black on a light background, since coloured or low-contrast bars often fail. The tool exports both PNG for quick placement and SVG for crisp scaling in label software, so you can size the symbol to your packaging without losing edge sharpness.

EAN-13 and Related Formats

EAN-13 sits within a small family of GS1 retail symbologies, and choosing the right one depends on what you are labelling and where it sells. UPC-A, generated by the UPC-A generator, is effectively EAN-13 with a leading zero and is the North American counterpart. Books use a specialised variant built from the ISBN, which the ISBN Barcode Generator tool produces with the correct prefix. For non-retail uses such as logistics or asset tagging, an alphanumeric format is usually a better fit than a fixed 13 digit retail code. If you only need one barcode, this generator is enough, but when you are labelling a whole catalogue, the Bulk EAN-13 Barcode Generator tool turns a list of product numbers into a batch of EAN-13 images at once. Matching the symbology to the use case avoids reprints and failed scans down the line.

The ones we answer the most.

What do the first three digits of an EAN-13 mean?

They are part of the GS1 prefix, which is administered by a national numbering authority and is commonly associated with a country or region. The prefix indicates where the number was registered, not necessarily where the product was made. After the prefix come the company and product segments, then the check digit.

Do I enter 12 or 13 digits?

Enter the first 12 digits and let the tool calculate the thirteenth check digit for you. If you already have a full 13-digit number, you can paste all of it, and the tool will recompute the check digit and confirm whether the one you supplied is valid.

Can I invent a number for products I sell in my own store?

For items you sell only in your own store and never list with outside retailers, you can assign numbers from internal-use ranges that some retailers reserve for that purpose. The generated barcode will scan fine. For anything sold through other retailers or marketplaces, you should license a real company prefix from GS1 so your numbers stay globally unique.

What happens if I type an invalid check digit?

If you paste a full 13-digit code whose final digit does not match the calculated checksum, the tool flags it and shows the correct check digit. You can then either fix the input or let the tool generate the barcode using the valid digit, so you never ship a code that fails verification.

Will the barcode scan at any size I print it?

Not at any size. EAN-13 has a nominal size with an allowed magnification range, and printing too small makes the bars too fine to read. Keep the quiet zones on the left and right clear, use solid black bars on a light background, and export the SVG when you need to scale without blurring.

How is EAN-13 different from UPC-A?

They are very close. UPC-A is a 12-digit code used mainly in North America, and it is effectively an EAN-13 with a leading zero. A scanner reads both, and the check digit math is the same family. If you specifically need UPC-A, the UPC-A Barcode Generator tool generates it directly.