Barcode Generator

[ BARCODE ]
5901234123457
95
Modules
9 each side
Quiet zone
7
Check digit
The first digit is not drawn as bars. It is carried by which of the two left-hand alphabets each of the next six digits uses, which is why the symbol is 95 modules rather than the 102 a straight count suggests.
The check digit 7 was computed and appended.
The white margin either side is part of the code. It is 9 modules wide and a scanner needs it. Cropping the image tight to the bars is the commonest reason a generated barcode will not read.
Encoded in your browser — nothing is sent anywhere. These symbologies are checked structurally and by decoding them back, which is not the same as a scanner. Test with a real reader before printing them on anything that matters.
[ WHAT THIS IS ]

The check digit is the part worth understanding. The last digit of an EAN-13 or UPC-A is not data — it is computed from the twelve before it, and it exists so that a scanner can tell when one of them has been misread.

Which is why this page refuses a wrong one rather than fixing it. If the check digit does not match, some other digit is mistyped; silently replacing the last one gives you a barcode that scans perfectly and identifies a different product. That is the worst outcome available, and it is what a helpful tool would quietly hand you.

The first digit of an EAN-13 is not drawn. Look at the bars and you will find twelve digit symbols, not thirteen. The missing one is carried by which of two left-hand alphabets each of the first six digits uses — the parity pattern. It is why the symbol is 95 modules wide instead of 102, and why an EAN-13 cannot be read symbol by symbol from the left.

The white margin is part of the barcode. The quiet zone is nine modules on an EAN-13 and ten on the others, and a scanner needs it to find where the symbol begins. Cropping an image tight to the bars is the single commonest reason a generated barcode will not read, so the download here includes it.

One thing this cannot give you: a number. Retail codes are issued by GS1 and the prefix identifies the company that owns it. A made-up EAN will scan and may already belong to somebody else's product. For internal labels, use Code 128 — that number space is yours.

[ QUESTIONS ]

What is the check digit and why will it not let me type my own?

The last digit of an EAN-13 or UPC-A is computed from the others, and its whole purpose is to catch a mistyped digit. If the one you enter does not match, something else in the number is wrong — so this refuses the code rather than correcting the last digit for you. A "corrected" barcode is perfectly scannable and points at a different product, which is worse than no barcode at all. Enter twelve digits and it computes the thirteenth.

Why is the first digit of an EAN-13 not in the bars?

Because there is no room for it. There are only twelve digit symbols in the pattern. The thirteenth is carried by which of two left-hand alphabets each of the first six digits uses — the parity pattern. That is why an EAN-13 is 95 modules wide rather than the 102 a straight count suggests, and why you cannot read one symbol at a time from left to right.

Why does my barcode not scan?

Nine times out of ten, the quiet zone. The blank margin either side of the bars is part of the symbol, not decoration, and cropping an image tight to the bars removes it. The margin is included in the download here. The other common causes are printing it too small, printing it on a curved or shiny surface, and insufficient contrast — black on white, always.

Which symbology should I use?

EAN-13 or UPC-A if the item will be sold at retail, and only with a number issued to you by GS1 — a made-up one may already belong to somebody else. Code 128 for anything internal: it takes any printable ASCII and packs digits two to a symbol, so it is compact. Code 39 when you need something an old or simple reader will definitely handle, accepting that it is about a third wider.

Can I invent my own EAN-13 number?

You can generate one here, and you should not put it on anything for sale. Retail barcode numbers are issued by GS1 and the prefix identifies the company that owns it. A made-up number will scan happily and may collide with a real product somewhere in the world. For internal stock, labels and asset tags, use Code 128 instead — nobody owns that number space.

Do you check that these actually scan?

Not with a scanner, and it is worth being straight about it. Each symbology is verified structurally and by decoding the generated pattern back to the original value, which is a genuine check and catches most classes of error. The QR generator on this site was additionally compared against a reference encoder and read with a real camera; these have not been. Test with a physical reader before printing them on anything that matters.

[ THE MATHS ]
The EAN-13 check digit
Weight the digits 1, 3, 1, 3 …from the left, twelve of them
Add them up5 + 27 + 0 + 3 + … for 590123412345
Take the total modulo 1083 → 3
Subtract from 10, modulo 10→ 7, the check digit

The alternating weights are what make it catch a transposition — two swapped digits change the total.

[ WHAT EACH SYMBOLOGY COSTS ]
Encoding twenty digits
Code 39334 modules
Code 128, treated as text255 modules
Code 128, digits packed two per symbol145 modules

Code 128 has a numeric mode that carries two digits in the space of one character. It is used automatically here when a run of digits is long enough to pay for the switch.

[ NEXT ]
41QR Code GeneratorTwo dimensions, and far more capacity
47Secret Key GeneratorAlso generated entirely in the browser
48Text ComparisonCheck two product lists against each other
43JSON FormatterTidy the catalogue file first
[ IMPORTANT ]

Generated in your browser; nothing is transmitted. These symbologies are verified structurally and by decoding them back, which is not the same as testing with a scanner — check with a real reader before printing at scale. Retail barcode numbers must be issued by GS1. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.