Online Code 128 Barcode Generator
Code 128 is the barcode you have scanned a thousand times without noticing — on parcels, SKU labels, and the shelf edge in a warehouse. It is dense, it handles the full ASCII set (letters, numbers, punctuation, even control characters), and it squeezes long strings into a surprisingly small footprint.
Where it earns its keep
That compactness is the whole point. A serial number that would run off the edge of a label in Code 39 stays tidy in Code 128, partly thanks to a numeric mode that packs two digits into the space of one. It is also the backbone of the GS1-128 shipping standard, where a single label might carry a GTIN, a batch number, and an expiry date back to back — that is what the "AI" brackets like (01) and (17) on a logistics label are doing.
Under the hood the format has three character subsets. Subset A covers uppercase and control characters, Subset B adds lowercase, and Subset C encodes digit pairs at double density. A good generator switches between them automatically to produce the shortest possible symbol, so you never have to think about it — but it explains why an all-numeric Code 128 is visibly narrower than a mixed-text one of the same length.
Technical specification
| Character set | All 128 ASCII characters (letters, digits, symbols, control codes) |
| Length | Variable — practical limit around 40–50 characters per label |
| Check digit | Mandatory, modulo 103, calculated automatically and not printed as text |
| Minimum X-dimension | 0.25 mm (10 mil) for general use; 0.495 mm for GS1-128 logistics labels |
| Quiet zone | 10× the X-dimension on each side |
Printing notes
Code 128 tolerates small print well, but its density cuts both ways: narrow bars mean less room for error. On a 203 DPI thermal printer keep the X-dimension at a whole multiple of the 0.125 mm dot size, and always export as vector — a resized PNG is the single most common cause of a Code 128 that scans intermittently.
Frequently asked questions
Code 128 or Code 39 — which should I use?
For anything new, Code 128. It encodes more characters in less space and has a mandatory checksum. Code 39 only wins when a legacy system or an industry spec (some military and healthcare standards) explicitly requires it. The full comparison is in Code 128 vs Code 39.
What is the difference between Code 128 and GS1-128?
GS1-128 is Code 128 with rules on top: a special FNC1 start character and standardised Application Identifiers that tell the scanner "this part is a GTIN, this part is an expiry date." The bars look the same; the data structure is what changes.
How small can I print it?
Keep the narrowest bar at or above 0.25 mm and the height at 15% of the symbol length or 13 mm, whichever is greater. Below that, cheap laser scanners start to struggle — test with your actual hardware before committing a full run.
Generating a batch of SKU labels? The bulk generation guide covers the full spreadsheet-to-PDF workflow, and the thermal printing guide explains the printer settings that keep dense codes scannable.