EAN-13 Barcode Generator
A barcode that merely looks like a barcode fails at the till rather than on the page, which is no use to anybody. The only check worth having is the one a scanner does: read the bars back and see what number comes out. That is what happens here — the pattern is drawn, then decoded from the drawing alone and compared with what went in.
What this generator does
Works out the check digit, encodes the number as ninety-five bars and spaces with the proper guard patterns, and draws it as a scalable image with the digits underneath.
How to use this tool
- Enter twelve digits, or thirteen if you already have the check digit.
- Draw the barcode and read the check digit worked out for you.
- Note that the first digit appears under the bars but is not drawn in them.
- Use the button to make up a number if you just want an example.
Understanding the controls
- Number
- Twelve digits, and the thirteenth is worked out. Give thirteen and the check digit is verified rather than replaced — a number with the wrong one is refused rather than quietly corrected.
Common use cases
- Producing a barcode for a product number you already have
- Working out the check digit for a twelve-digit number
- Making a scannable example for testing a till or a scanner app
- Understanding how a thirteen-digit number fits into twelve digits of bars
- Checking that a number you were given is a valid EAN-13
How this generator works
The drawn pattern is decoded again from scratch — guards checked, each seven-module block matched against the digit tables, and the number reassembled. That single check catches a wrong digit table, a missing guard and a mis-set parity at once. It also catches the subtle one at the heart of the format: the first digit is never drawn anywhere. It is carried entirely by which of two codes each of the next six digits uses, so a barcode with the wrong pattern scans as a different product altogether.
Randomness and fairness
Only the made-up number is random, drawn from the browser's secure generator. The bars themselves are not: a given number always produces exactly the same pattern.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- EAN-13 only. UPC-A, EAN-8, Code 128 and the two-dimensional codes are different formats.
- The number is not checked against any product database — a valid barcode is not necessarily an assigned one.
- Printing a barcode small or on a poor printer can make it unscannable however correct the pattern is.
- No quiet-zone markers are drawn, and scanners want clear space either side of the bars.
Privacy and your data
The barcode is drawn in your browser. No number is transmitted or stored.
Related generators
- Damm Check Digit GeneratorAdds a check digit that catches every single mistyped digit and every swap of two neighbours, and proves it by trying them all.
- Barcode Number Example GeneratorA 12-digit UPC-A-shaped example number with a correct check digit — not a real, assigned barcode.
- ISBN Example GeneratorAn ISBN-13-shaped example number with a correct check digit, for test data that has to pass validation.
- De Bruijn Sequence GeneratorOne sequence containing every possible run of a given length exactly once — 10,003 keypresses for all 10,000 four-digit codes.