Barcodes
Choosing a barcode for warehouse, asset and inventory labels
Which symbology to put on a bin, a carton, an asset tag or a 5 mm component, plus the X-dimension and print settings that decide whether it scans at all.
Four thousand bins, eight hundred laptops and a spreadsheet that has drifted from reality. Someone asks which barcode to print, and the honest answer is that the symbology is the easy part — but getting it wrong means reprinting every label, so it is worth twenty minutes.
Code 128 is the default
Start here and only move if something forces you off it.
Code 128 encodes the full 128-character ASCII set, so
SHIP-4417-A, BIN/07/C-12 and a serial number with a slash in it are all
valid without contortions. Nobody allocates the numbers — unlike the retail
formats covered in the EAN and UPC guide, you decide
what the symbol says and your system decides what it means.
Its density comes from three interchangeable subsets. Subset A holds upper case and control characters, B upper and lower case and punctuation, and C packs two digits into one symbol character. A good encoder switches between them mid-symbol, so a long numeric run ends up roughly half the width any other linear format would need. It carries a modulo 103 check character that is computed automatically and never printed.
The variant to know about is GS1-128, the same symbology with a leading FNC1 and GS1 Application Identifiers structuring the payload, so a scanner can tell a batch number from an expiry date. If a carrier has sent you an SSCC label specification, that is what they mean.
When Code 39 still wins
Code 39 encodes only digits, capitals, a space and six symbols, and runs 30 to 40% wider than Code 128 for the same data. On the merits, Code 128 wins every time.
Something does often override the merits. Code 39 is written into the US Department of Defense LOGMARS specification, into AIAG labelling across the automotive supply chain, and into a great many access-control, library and laboratory systems installed decades ago and never touched since. It is also self-checking — its fixed nine-element character structure means a single misprinted bar produces an invalid character rather than a plausible wrong one — which is why some very old fixed-function scanners were only ever configured for it.
The rule: if a written specification names Code 39, or if the scanners on the floor predate the century, print Code 39. Otherwise do not.
Cartons
Interleaved 2 of 5 encodes digits in pairs, one in the bars and one in the spaces between them, which makes it the most compact purely numeric linear format in common use and is why its data length must always be even. The density comes at a cost: because every element carries data, nothing marks the middle of the symbol, so a scan that clips the start or end can return a shorter number that looks entirely legitimate. That is the classic short read.
Two defences work. Fix the length across the whole deployment and configure the scanners to reject anything else, which kills almost every short read outright. Or use ITF-14, which is Interleaved 2 of 5 constrained to fourteen digits with a mandatory check digit and a bearer bar — the heavy frame that stops a beam clipping the top or bottom edge from decoding a fragment. Anything crossing a company boundary should be ITF-14 or Code 128, never raw ITF.
Data Matrix for small parts
Data Matrix is the answer whenever the label is measured in single millimetres. The arithmetic is what decides it.
The smallest Data Matrix is 10 × 10 modules and needs a one-module quiet zone on each side: 12 module-widths across in total. The smallest QR code is 21 × 21 with a four-module quiet zone: 29 module-widths. On a 5 mm-wide mark that is the difference between 0.42 mm modules and 0.17 mm ones. The first prints on a 300 dpi label printer and scans on an ordinary imager; the second does neither.
Data Matrix also uses ECC 200 Reed–Solomon correction, recovering the payload from a symbol with roughly a quarter of its area damaged, and its solid L-shaped finder plus alternating clock track let it be read at angles that defeat a linear barcode. That combination is why it ends up dot-peened onto castings, laser-etched onto surgical instruments that are autoclaved weekly, and printed on the one flat panel of a medicine carton.
Two conditions. It must be marked square — distort one axis and the clock track stops matching the reconstructed grid — and it needs genuine light-to-dark contrast under the imager’s illumination, which on metal means a real marking process rather than a shallow scratch. And it needs 2D imagers on the floor: a laser scanner cannot read it at all.
PDF417 for documents
PDF417 holds up to 1,850 text characters, 2,710 digits or 1,108 bytes — a whole record rather than a pointer to one. That makes it right for paperwork that has to stay readable with no database behind it: goods-in notes, transfer dockets, customs paperwork, ID cards. Error correction is selectable from level 0 to 8; level 5 is a sensible default for paper that will be folded and stapled. It is wide and short, so give it the full width of the area and never squash the rows vertically to make it fit.
The decision table
| Situation | Format | Why |
|---|---|---|
| Bin, shelf, location label | Code 128 | Alphanumeric, dense, no registration |
| Asset tag on a laptop or tool | Code 128 | Same, plus a readable asset number |
| Legacy scanner or named in a spec | Code 39 | Compatibility, self-checking |
| Outer carton, GS1 | ITF-14 | Bearer bar, fixed length, survives corrugate |
| Carton, closed internal system | Interleaved 2 of 5 | Compact numeric, if lengths are fixed |
| Component under 10 mm | Data Matrix | 12 module-widths minimum |
| Direct part marking on metal | Data Matrix | ECC 200 survives etching and wear |
| Document carrying a full record | PDF417 | Offline capacity |
| Retail item sold at a till | EAN-13 / UPC-A | GS1-allocated, not your choice |
Check the scanners before you commit. If the floor runs laser scanners, every 2D row in that table is unavailable until the hardware changes.
X-dimension and print quality
The X-dimension is the width of the narrowest bar, and it has to be a whole number of printer dots. A 203 dpi thermal printer lays down 0.125 mm dots, so your realistic choices are 0.25 mm (two dots) or 0.375 mm (three). A 300 dpi printer gives 0.085 mm dots and finer control. Asking for 0.3 mm on a 203 dpi printer does not produce 0.3 mm bars — it produces a mix of two- and three-dot bars and a wide-to-narrow ratio that drifts across the symbol.
Bigger X is more robust. Go as wide as the label allows, and only shrink when the data will not fit; if it will not fit at a sane X-dimension, shorten the data rather than the bars.
Print linear symbols in picket-fence orientation where the printer allows — bars perpendicular to the direction the label feeds. A failed printhead element then draws a thin white line along the length of the bars, which decoders tolerate, rather than across them, which they do not.
Then choose the right process:
- Direct thermal has no ribbon and images a coated paper with heat. It fades with heat, sunlight and abrasion. Fine for a shipping label scanned within the week; wrong for anything that has to last.
- Thermal transfer, wax ribbon on paper suits indoor stock labels with a life measured in months.
- Thermal transfer, resin ribbon on synthetic is what an asset tag needs: resistant to solvents, cleaning, abrasion and heat, and still legible after five years on the underside of a laptop.
Print black on white. Coloured stock and light-on-dark both cost you contrast you will want back in a badly lit aisle.
Human-readable text, quiet zones and placement
Always print the encoded value as text under the bars. Scanners fail, labels get scuffed, and somebody eventually has to key it in — and the alternative is a worker photographing the label and phoning a supervisor. Keep that text outside the quiet zone rather than tucked against the symbol. On Code 39 the asterisks you sometimes see at each end are start and stop characters, not data, so do not type them.
Quiet zones are not decoration; the decoder uses them to find the symbol’s edge.
| Format | Quiet zone |
|---|---|
| Code 128, Code 39, Interleaved 2 of 5 | 10 × narrow-bar width, each side |
| Data Matrix | 1 module, all sides |
| PDF417 | 2 modules, all sides |
| QR | 4 modules, all sides |
Finally, be boring about placement. The same position on every label, so a picker knows where to point without looking. Never across a carton edge, a fold, a seam or the tape line — a crease reads as a break in the bars. Never wrapped around a corner. For GS1 case marking there is a specified minimum height above the base of the carton so the symbol survives handling; take that from the current General Specifications rather than eyeballing it.
Build the labels in the barcode generator and export SVG, because vector artwork keeps its edges when a label template rescales it and a raster one does not.
Frequently asked
What is the best barcode for inventory and asset labels?
Why use Data Matrix instead of a QR code on a small part?
What X-dimension should a warehouse barcode be printed at?
Should asset labels be printed on a direct thermal printer?
- inventory
- code-128
- data-matrix
- labels
- warehouse
Make the code this guide describes
The generator runs in your browser — add a logo, pick colours, tag the link with UTM parameters and download a PNG or SVG. No account, no watermark.
Keep reading
-
Barcodes
EAN-13 vs UPC-A: which one your product needs
UPC-A is an EAN-13 with a leading zero, so the real question is where your number came from. Digit counts, check digits, GS1 prefixes and the case code.
-
Printing
What size should a printed QR code be?
The distance-to-size rule that decides whether a printed QR code scans, the minimum millimetres per module, and the quiet zone people keep cropping off.
-
Barcodes
Barcode or QR code, and what converting one into the other really means
A QR code is a barcode. Converting between the two means re-encoding the data, not transforming an image — and at a checkout that distinction decides it all.