What this actually supports
Three symbologies: Code 128 in subsets B and C, EAN-13, and UPC-A. Nothing else — no Code 39, no ITF-14, no GS1-128 application identifiers, no PDF417 or Data Matrix, and no QR codes (the QR generator handles those). If a specification names a symbology not on that list, this tool cannot produce it and you should not try to approximate.
UPC-A is not a separate encoding here, and that is not a shortcut: a UPC-A symbol is exactly an EAN-13 whose leading digit is zero, and the check digit algorithm is the same one. The difference is in how the digits are printed under the bars, not in the bars.
The check digit, precisely
EAN-13 and UPC-A both carry a mandatory check digit as their final character. It is computed over the preceding digits: reading left to right, multiply the first by 1, the second by 3, the third by 1, and so on alternating; sum them; the check digit is whatever brings that sum up to the next multiple of ten.
Worked through on a real code, 4006381333931: the first twelve digits are 4 0 0 6 3 8 1 3 3 3 9 3, and with weights 1 3 1 3 1 3 1 3 1 3 1 3 the products are 4, 0, 0, 18, 3, 24, 1, 9, 3, 9, 9, 9, giving a total of 89. The next multiple of ten is 90, so the check digit is 1, which matches the printed code. UPC-A works identically once you prepend the implied zero: for 03600029145, the twelve digits 0 0 3 6 0 0 0 2 9 1 4 5 weight out to 0 + 0 + 3 + 18 + 0 + 0 + 0 + 6 + 9 + 3 + 4 + 15 = 58, giving a check digit of 2 and the full code 036000291452.
A wrong check digit does not scan. There is no partial credit and no error message at the till — the scanner computes the digit itself, finds a mismatch, and discards the read as noise. This tool computes it when you supply the short form and verifies it when you supply the long form, refusing to draw a symbol it knows is invalid.
Code 128 and its checksum
Code 128 has its own check character, computed differently: the start code's value plus each data value multiplied by its position, modulo 103. Subset B covers printable ASCII from space to tilde; subset C packs two digits into one symbol, so a long numeric string encodes at half the width. This generator starts in B and switches to C whenever four or more digits run consecutively, which is the usual heuristic. Characters outside ASCII 32-126 — accented letters, anything Korean or Japanese, emoji — cannot be represented and are rejected rather than silently mangled.
Getting it to scan
| Factor | Requirement | Why |
|---|---|---|
| Module width | 0.25 mm minimum in print | Below this, ordinary scanners cannot resolve the narrow bars |
| Quiet zone | 10 modules clear on each side | The scanner needs blank space to find the symbol's edges; this tool adds it |
| Scaling | Whole-number factors only | Interpolation blurs bar edges and shifts their apparent width |
| File format | PNG, never JPEG | Lossy compression rings around every high-contrast edge |
| Contrast | Black on white, no tints | Coloured or greyed bars reduce the reflectance difference scanners key on |
The quiet zone is the one people most often destroy after generating a correct symbol, by cropping tight to the bars or placing the image against a coloured panel.
Which one to use
Anything internal — asset tags, member numbers, ticket references, shelf locations, work orders — is Code 128. It takes letters and symbols, has no length limit worth worrying about, and nobody has to allocate you a number. Anything crossing a retail till is EAN-13 or UPC-A, and the number itself must be one issued to you through GS1. A self-invented retail code will scan perfectly and then collide with somebody else's product in somebody else's inventory system, which is a worse outcome than not scanning at all.
Questions people ask
Can I sell a product with a barcode I generated here?
The symbol will be drawn correctly and it will scan, but that is not the same as the number being yours. Retail numbers are allocated through GS1, and using an unallocated one means your product shares an identifier with something else in every system that stores it — inventory, ordering, point of sale. Get the number issued, then use this tool to render it.
Why does it reject non-ASCII characters?
Code 128 encodes ASCII 32 to 126 and nothing else. There is no representation for an accented letter, a Hangul syllable or an emoji, so encoding one would mean silently substituting something and producing a symbol that scans as the wrong data. Refusing is the safer failure. For arbitrary text, use a QR code, which encodes UTF-8 directly.
My phone will not read the barcode on screen.
Screens are a hostile surface for barcode reading — backlight, glare, the pixel grid interacting with the scanner, and refresh flicker all degrade the read, and many laser scanners will not read a display at all. Raise the module width to 3 or 4 px, put screen brightness up, and let the symbol fill most of the camera frame. If it still fails, print it: paper reads far more reliably than glass.
How large should I place the image in a document?
Work backwards from the 0.25 mm minimum module. At 2 px per module, printing at 200 DPI gives each module 0.25 mm, so that is the effective ceiling on placement resolution; place it larger and the modules get wider, which is fine. What is not fine is scaling by an arbitrary fraction, which resamples the bars and blurs their edges. Change the module width here and regenerate rather than stretching the PNG.