How Code 128 encodes text
Code 128 turns each character into a symbol of three bars and three spaces that together are 11 modules wide (a module is the width of the thinnest bar). A complete barcode is: a quiet zone, a start symbol that picks set A, B or C, the data symbols, a check symbol, a 13-module stop pattern, and another quiet zone. It was introduced in 1981 by Computer Identics and is standardised as ISO/IEC 15417.
| Code set | Characters | Good for |
|---|---|---|
| A | A–Z, 0–9, punctuation, ASCII control characters (such as tab) | Older systems that send control codes |
| B | A–Z, a–z, 0–9, punctuation | Mixed text: product codes, names, SKUs |
| C | Digit pairs 00–99, two digits per symbol | Long numbers: tracking, serials, order numbers |
Code 128 samples and their size
Because set C stores two digits per symbol, numbers make much narrower barcodes than letters. These widths were measured with this generator, without the quiet zones (add 10 modules on each side):
| Sample value | Code sets used | Width in modules |
|---|---|---|
1234567890 | C only | 90 |
ABC-12345 | B, then C | 123 |
SKU-00042 | B, then C | 123 |
ABCDEFGHIJ | B only | 145 |
At a module width of 0.33 mm, the 123-module sample above is about 4 cm wide plus its margins. If your label is narrow, shorten the value or use more digits; a QR code or DataMatrix stores much more in less space.
Tips for Code 128 labels
- Stick to plain ASCII. Accented letters and emoji are outside the 128 basic characters; scanners may decode them differently, so test before printing.
- Keep the human-readable line (on by default) so people can type the code when a scan fails.
- Use one value per line in Bulk to number a whole shelf or batch of parcels at once — up to 500 barcodes per ZIP.
- Need a retail product barcode instead? Shops scan UPC-A or EAN-13, not Code 128. All formats are on the main barcode generator.