Home › Generators & Text Tools › EAN Barcode Generator
EAN Barcode Generator
You need a barcode for a label, a prototype, or a shelf test — and the last digit, the check digit, is the one nobody can guess. This free EAN barcode generator does the whole job: enter 12 digits for EAN-13 (or the full 13 to validate one), or 7 digits for EAN-8, and it computes the check digit, draws a true standards-based barcode, and gives you a print-ready PNG.
Nothing leaves your device. The barcode is drawn in your browser — your numbers are never uploaded to any server.
How it works
An EAN barcode is 95 black-and-white stripes (modules) for EAN-13, and every digit is a seven-module pattern. What makes EAN clever — and confusing the first time — is that the left half uses two different pattern sets:
Each left digit is drawn with the L pattern (odd parity) or the G pattern (even parity), and which one is used at each of the six positions encodes the very first digit of the code — that is why the first digit never appears as bars. The right digits always use the R patterns. The long bars at the start, middle and end are guard bars; scanners use them to orient themselves and to know where the two halves split. This generator implements those exact pattern tables in its own code — no barcode library, nothing loaded from anywhere else — and draws the result to a canvas at high resolution with the human-readable digits underneath, first digit to the left, the way real labels print.
The check digit is the error trap: multiply alternate digits by 3, add everything up, and the check digit is whatever brings the total to a multiple of 10. If a till ever reads a digit wrong, the sum fails and the scan is rejected instead of ringing up the wrong product. Enter 13 digits and this tool verifies your check digit instead of computing one; enter 12 and it computes and appends it. EAN-8 works the same way in miniature: 67 modules, four digits each side, weights 3-1-3-1-3-1-3 on the first seven digits.
Worked example
The digits 590123412345 are the classic textbook example. Odd positions from the left (5, 0, 2, 4, 2, 4) sum to 17; even positions (9, 1, 3, 1, 3, 5) sum to 22, and 22 × 3 = 66. Total 17 + 66 = 83, so the check digit is 10 − 3 = 7, and the full code is 5901234123457 — the number this page shows by default. Type those digits, press Generate, and the barcode that appears is the same symbol printed in GS1 documentation: scan it with any phone barcode app and it will read back 5901234123457.
Printing barcodes that actually scan
Scanners are forgiving about size and ruthless about contrast and quiet zones. Keep the clear space on both sides of the symbol — roughly 4 mm on the left of an EAN-13 and 3 mm on the right — because a barcode cropped tight to a label edge is the number-one reason home-printed labels fail. Print black bars on white where you can; dark blue or dark green on white usually works, red bars do not, because most scanners shine red light and see red as white. And never stretch a barcode in one direction to make it fit: the module proportions are the data. If you need it smaller, regenerate or scale the PNG evenly — the height selector here changes only the bar height, which is the one dimension you may adjust freely.
FAQ
How is the EAN-13 check digit calculated?
Take the first 12 digits. Add the digits in odd positions (1st, 3rd, 5th… counting from the left) together, then add the digits in even positions multiplied by 3. The check digit is whatever makes the total a multiple of 10. For 590123412345: the odd positions sum to 17, the even positions to 22, so 17 + 66 = 83, and the check digit is 7 — giving the full code 5901234123457.
What is the difference between EAN-13 and EAN-8?
EAN-13 carries 13 digits and is the standard product barcode used worldwide outside North America. EAN-8 carries 8 digits and exists for small packages where a full EAN-13 physically does not fit — lipsticks, chewing gum, small cosmetics. Both use the same bar language; EAN-8 simply encodes fewer digits and its check digit weights the first seven digits 3, 1, 3, 1, 3, 1, 3.
Can I sell products with a barcode made here?
The barcode image is a perfectly valid, scannable EAN symbol, but retail product numbers must be licensed from GS1, the organization that allocates company prefixes so no two products collide. Inventing a number that happens to scan can clash with another company's product in a retailer's system. Use this generator for internal labels, prototypes, mockups and testing — license real numbers from GS1 for products going on sale.
Why does the first digit of an EAN-13 have no bars of its own?
It is encoded invisibly. The six left-hand digits can each be drawn in one of two patterns (called L and G), and the choice of pattern for each position spells out the first digit according to a parity table. Scanners read the pattern mix to recover it. That is why the first digit is printed outside and to the left of the bars — a human aid, since the bars themselves only imply it.
What size should I print the barcode?
The standard (100%) EAN-13 symbol is about 37.3 mm wide including quiet zones, and EAN-8 about 26.7 mm. You can scale down to roughly 80% or up to 200% and stay scannable, as long as the print is crisp and you keep the clear space (quiet zone) on both sides. The download from this tool is a high-resolution PNG: print it at the size you need rather than stretching a small image.