Generate Code 128 or EAN-13 barcodes as SVG, entirely in your browser - includes automatic check-digit calculation.
EAN check digit
For EAN-13, type 12 digits to have the check digit computed for you, or 13 digits to verify an existing code
"Barcode" is really shorthand for two unrelated symbologies that happen to look alike. Code 128 is the workhorse of logistics and inventory: it encodes the full printable ASCII range, so a warehouse label can pack a SKU, a lot number, and stray punctuation into a single scan. EAN-13 is the one printed on nearly every retail product worldwide - a fixed 13-digit number assigned by GS1, where the final digit is not part of the product identity at all but a checksum that lets a scanner catch a misread digit before it rings up the wrong item. This tool builds both symbologies directly in your browser: type a value, pick a symbology, and the bar widths are computed and rendered as SVG with nothing sent to a server. For Code 128, a run of four or more digits automatically switches to a denser numeric mode, which is why a mostly-numeric label often scans narrower than one built from mixed letters and numbers of the same length.
Retailers usually only know the 12-digit item number GS1 assigned them, like 400638133393. Feed that in and the encoder appends the check digit for you: it computes to 1, giving the full 13-digit code 4006381333931 - the number that actually gets printed on the package and scanned at checkout.
A warehouse tag reading ABC123 (a letter prefix plus a numeric suffix) encodes as Code 128 starting in mode B: A, B, C, 1, 2 and 3 each contribute a value (33, 34, 35, 17, 18, 19) on top of the start code, and those combine into a checksum of 67 that gets appended before the bars are drawn. That checksum is what lets a scanner reject a smudged read instead of silently logging the wrong SKU.
Switch to a purely numeric value like 1234 and the encoder detects the run of four-plus digits and drops into Code C, pairing the digits into 12 and 34 instead of encoding four separate characters - the checksum comes out to 82. Because each pair of digits now costs one symbol width instead of two, the resulting bars are noticeably narrower than an equivalent mixed-character value would be.
Is EAN-13 the same thing as UPC-A?
Almost. UPC-A is the 12-digit code used mostly in the US and Canada; EAN-13 is the 13-digit international superset used almost everywhere else. Every UPC-A code is also a valid EAN-13 code with a leading zero, which is why US point-of-sale scanners read both without any special handling.
How is the EAN-13 check digit actually calculated?
Starting from the first digit, odd positions are weighted ×1 and even positions ×3, the results are summed, and the check digit is whatever value rounds that sum up to the next multiple of 10. For 400638133393 that arithmetic lands on 1, which is why the printed code ends in ...31 rather than ...30 or any other digit.
Can Code 128 encode letters, not just digits?
Yes - that is its main advantage over EAN-13. Code 128 covers the full printable ASCII set (letters, digits, punctuation, spaces), which is why shipping labels and inventory tags reach for it for values like lot numbers or SKUs that mix letters and numbers, not just plain digit strings.
I typed 12 digits but the barcode shows 13 - why?
The 12 digits you typed are the product identity; the 13th digit the tool adds is the check digit computed from those first 12. You only ever need to type the identity - the tool fills in the checksum whether you gave it 12 digits (compute mode) or a full 13 (verify mode, where it also confirms the check digit you supplied is correct).
How much blank space does a barcode need around it to scan reliably?
Every symbol here is rendered with a quiet zone - blank margin - of at least ten module-widths on each side of the bars. Without that margin a scanner cannot reliably tell where the symbol starts and stops, so avoid cropping tight to the bars themselves when placing a barcode on packaging or a label.