How the six formats differ
Every format here is a one-dimensional barcode: a row of bars and gaps whose widths encode characters. The formats differ in what they can hold and in how a scanner knows it read them correctly.
| Format | Accepts | Check digit | Typical use |
|---|---|---|---|
| CODE128 | Any ASCII text | Built in, handled by the encoder | Shipping labels, inventory, asset tags |
| EAN-13 | 12 or 13 digits | Last digit | Retail products worldwide |
| EAN-8 | 7 or 8 digits | Last digit | Very small packages |
| UPC-A | 11 or 12 digits | Last digit | Retail products in North America |
| CODE39 | Digits, capital letters, and a few symbols such as - . $ / + % | None required | Older industrial and ID-badge systems |
| ITF-14 | 13 or 14 digits | Last digit | Outer cartons and cases |
Check digits, with a real calculation
For EAN-13, the digits are weighted 1, 3, 1, 3 and so on from the left, summed, and the check digit is whatever brings the total up to the next multiple of 10. For the twelve digits 590123412345 the weighted sum is 83, so the check digit is 7 and the full code is 5901234123457. If you type only 12 digits the encoder appends that 7 for you. If you type 13 digits and the last one is wrong, such as 5901234123458, the tool shows its error message and disables both download buttons.
UPC-A works the same way with the weights reversed: digits in odd positions are multiplied by 3. For the eleven digits 03600029145 the check digit comes out as 2, giving 036000291452.
Common mistakes
- Treating a valid pattern as a real product code. A correct check digit only proves the number is well formed. Numbers for goods sold through shops are licensed by GS1, so a made-up EAN will scan but may collide with someone else's product.
- Using EAN-13 for internal labels. Pick CODE128 for your own SKUs; it takes letters and any length.
- Bars that are too thin. The width control runs from 1 to 6 pixels per module. A 1 pixel bar looks fine on screen but prints poorly on a low-resolution thermal printer, so raise it for print.
- Lowercase in CODE39. The format only defines capital letters; the encoder uppercases what you type.
- Clipping the quiet zone. Keep blank space on both sides of the printed bars. The tool adds a 10 pixel margin, and cropping it can stop scans.
Need to encode a link or longer text instead? A two-dimensional symbol is a better fit, so try the QR code generator.