
Code 128: a practical code for warehouse labels
Code 128 for warehouse labels: it encodes all 128 ASCII characters, letters, digits and symbols, in a compact bar pattern, which suits internal stock labels.
A warehouse label often needs letters as well as digits: INV-000418 (equipment), A-03-02 (a rack), PL-261015-007 (a pallet). EAN-13 cannot do that, because it is strictly 13 digits and holds only numbers. For such internal labels people usually choose Code 128, and there are concrete reasons for it.
What makes Code 128 convenient
- A wide character set: it encodes all 128 ASCII characters, including digits, upper and lower case letters, hyphen, full stop, slash and more.
- Free length: a three-character rack number and a twenty-character batch number are written in the same standard.
- Compact: digits are packed in pairs, so a long numeric code comes out very short.
- Reliable: the code carries its own check character, so a scanner rarely lets a misread through.
For these reasons Code 128 is widespread on shipping, transport and internal stock labels.
Three subsets: A, B and C
Code 128 contains three "alphabets". Subset B includes upper and lower case letters, digits and punctuation, and most labels are written in it. Subset A is for capitals, digits and control characters. Subset C is for digits only: two digits are written as a single character, so the density doubles.
The code switches between subsets by itself. Let us count. The label INV-000418 has ten characters. Written entirely in subset B, the code is 145 modules wide. If INV- is written in B and the six digits in C, it comes to only 123 modules. On a 203 dpi printer with a 2-dot module (0.25 mm) the difference is 36 mm against 31 mm. Most label printers and software choose the subset automatically, so there is nothing to configure by hand.
Code 128 also has a special form, GS1-128. It is used on logistics labels: a special FNC1 character stands at the start, and the data is written with application identifiers (AI), such as batch and expiry date. An internal label does not need that complexity, and plain Code 128 is enough. Only if a pallet goes to an outside partner might they ask for GS1-128.
How to lay the code out on a label
- Module width: the thinnest bar should be at least 0.25 mm. On a 203 dpi printer that is 2 dots. If the code gets dusty, scratched or is read from afar, take 3 dots (about 0.38 mm).
- Quiet zone: leave at least 10 modules of blank space on each side. At a 0.25 mm module that is 2.5 mm. No text or lines should fall into this zone.
- Height: for handheld scanning 10 to 15 mm is enough. A code that is too short is harder to read, because the beam is harder to aim accurately.
- Human-readable text: print the number in plain characters under the code as well; if the scanner fails, the data can be typed in.
On a label 58 mm wide a 12-character code fits easily. If the code will not fit across, do not squeeze it: shorten the text first.
Practical schemes for a warehouse
Work out the numbering system in advance:
- Fixed assets: INV-000418, a prefix plus a serial number.
- Racks: A-03-02, meaning row, rack, level. Write each part at the same length (A-03-02, not A-3-2) so lists sort correctly.
- Batch or pallet: PL-261015-007, a date plus a serial number.
- Avoid look-alike characters: O and 0, I and 1 are easily confused when written by hand. For numeric IDs use digits only.
Do not put a product name or price into the code. The database holds those, so let the code remain a short key; then the label never has to be reprinted.
When the scanner misbehaves
On most scanners Code 128 is enabled by default, but a few cheap models may have it switched off. If a scanner reads the code but adds extra characters such as ]C0 at the start, the "symbology identifier" option is on, and it can be turned off in the settings.
Conclusion
Code 128 is the most practical choice for internal labels: it holds letters and digits compactly and reliably. The Shtrix team designs a numbering scheme for fixed assets, racks and batches, prints labels with this code and applies them.