Code 128 Barcode Generator
Encode text and numbers into a Code 128 barcode.
How to use the Code 128 Barcode Generator
- Enter the text or number to encode.
- Download the barcode as PNG.
About the Code 128 Barcode Generator
Code 128 is the workhorse of shipping, logistics and internal asset labelling. It encodes the full ASCII character set — uppercase and lowercase letters, digits and symbols — and it is dense, packing more characters into less width than older formats. It does this by switching between three subsets (A, B and C), with subset C encoding pairs of digits in the space of one character, which is why a long numeric code comes out remarkably compact. Carriers, warehouses, hospitals and IT asset registers all lean on it, and virtually every scanner made in the last few decades reads it.
It is a 1D barcode, so unlike a QR code it must be scanned across the bars, not at any angle, and it holds far less data. Keep the value as short as the job allows: every character widens the barcode, and a wide barcode either needs a wider label or thinner bars that a cheap thermal printer will smear. Leave a clear quiet zone at both ends — the blank space before the first bar and after the last is not decoration, and crowding it with text or a border is a very common cause of no-reads.
Code 128 has no fixed length and no meaning of its own: it will happily encode any string, which makes it perfect for internal codes and useless as proof of anything. For retail checkout you need an EAN-13 instead.
Frequently asked questions
What characters can Code 128 encode?
The full ASCII set — letters in both cases, digits and common symbols. That flexibility is why it dominates shipping and asset labels, where codes mix letters and numbers.
How long can the data be?
There is no fixed limit, but there is a practical one: every extra character makes the barcode physically wider. Past a point it will not fit the label, or the bars get too thin for the printer to render cleanly.
Why does an all-digits code look shorter than text of the same length?
Code 128 has a subset that encodes two digits in the space of a single character. Numeric-only data therefore compresses to roughly half the width of the same number of letters.
Can I use this on products in shops?
No. Retail checkout expects an EAN-13 or UPC-A carrying a GTIN assigned by GS1. Code 128 is for shipping, logistics and your own internal numbering.
Do I need a check digit?
Code 128 has a mandatory check character built into the symbol, calculated automatically as part of the encoding. You do not add one yourself.

