Use Code 128 for most new labels: it encodes all 128 ASCII characters, has a built-in check character and is much more compact, especially for long numbers. Use Code 39 when a customer, industry standard or older system requires it (defence, automotive and healthcare labels often do), or for very simple capital-letter IDs. For retail products use EAN or UPC instead; for logistics data use GS1-128.
Code 39 and Code 128 are the two workhorse barcodes for anything that isn’t a retail product: asset tags, inventory labels, file folders, ID badges, work orders and parcel references. Choosing between them is mostly about space, characters and who will be scanning.
Side by side
| Code 39 | Code 128 | |
|---|---|---|
| Introduced | 1974 | 1981 |
| Characters | 43: A–Z, 0–9, space and - . $ / + % (Full ASCII mode adds the rest) | All 128 ASCII characters, upper and lower case |
| Check character | Optional (mod 43) | Built in and mandatory (mod 103) |
| Width for the same data | Wide | Compact; long numbers are about half the width |
| Start/stop | An asterisk (*) at each end | Start code A, B or C plus a stop pattern |
| Typical users | US defence (LOGMARS), automotive (AIAG), healthcare (HIBC), older systems | Shipping, warehousing, labs, general inventory, GS1-128 |
Why Code 128 is so much shorter
Code 128 has three character sets. Set C packs two digits into each symbol character, so a 12-digit number takes six characters instead of twelve. Generators switch sets automatically. Code 39 spends a fixed, fairly wide pattern on every single character, plus the gap between characters. For a 10-character mixed ID the difference is noticeable; for a 20-digit number it’s dramatic.
When Code 39 still makes sense
- A standard or customer requires it. Defence suppliers, some automotive and healthcare labels specify Code 39. Follow the spec.
- Very old scanners or software that were set up only for Code 39.
- Short, capital-letter IDs where space isn’t tight, like "BIN-A12".
- Easy to print by hand-made fonts. Each character stands alone, so a simple barcode font in Word can produce it, though a generator is more reliable.
When to choose Code 128
- New labelling projects with no legacy constraint.
- Long numbers (serials, order numbers, tracking references).
- Lower-case letters or punctuation in the data.
- Small labels where width is limited.
- Anywhere misreads would be costly; the mandatory check character catches most errors.
And Code 93, GS1-128, EAN?
| Need | Use |
|---|---|
| Retail product sold in shops | EAN-13 or UPC-A with a GS1 number |
| Batch, expiry, weight or SSCC on cartons and pallets | GS1-128 (Code 128 with application identifiers) |
| Something like Code 39 but more compact | Code 93 |
| Lots of data, or very small items | Data Matrix or a QR code |
A full overview is in barcode types explained, and shipping-specific codes in barcodes for shipping cartons.
Printing tips for both
- Leave a quiet zone (blank space) of at least 10 times the narrowest bar on each side; Code 39 and Code 128 both fail without it.
- Keep bars at least 10 to 15 mm tall for handheld scanners.
- Download vector (SVG or PDF) for printing; never stretch a small PNG.
- Test with the actual scanner your team uses, at the actual label size.
Frequently asked questions
What is the difference between Code 128 and Code 39?
Is Code 128 better than Code 39?
Can Code 39 include lower-case letters?
Which barcode should I use for inventory?
Can I use Code 128 on products sold in shops?
Create a Code 128 barcode
Automatic character sets and check digit. Download PNG, SVG or PDF.
Open Code 128 Generator