Code 39 vs Code 128: Differences and When to Use Each
Use Code 128 for almost anything new: it encodes the full ASCII set, prints smaller, and has a built-in check character. Choose Code 39 only when a system, standard or scanner setup already requires it, such as some government, automotive and military labels. Both are free to use and both read on nearly every scanner made in the last 20 years.
Character sets
| Code 39 | Code 128 | |
|---|---|---|
| Characters | 43: A-Z, 0-9, space and - . $ / + % | All 128 ASCII characters, including lowercase and control codes |
| Start/stop | Asterisk (*) at both ends | Dedicated start and stop patterns |
| Check digit | Optional (modulo 43) | Always present (modulo 103) |
| Numeric density | One digit per character | Two digits per character in subset C |
| Typical length | Short to medium | Short to long |
Code 39 has no lowercase letters. If your data contains "abc-123" you have to uppercase it or switch symbologies. Code 128 handles it without changes.
Density
Code 128 is more compact. A Code 39 character takes up nine bars and spaces, three of them wide, which adds up to roughly 13 to 16 modules depending on the wide-to-narrow ratio. A Code 128 character is 11 modules wide. When the data is all digits, Code 128 switches to subset C and packs two digits into each character, so a long numeric string can print at about half the width of the same string in Code 39.
That matters on small labels. Code 39 at the same narrow-bar width can force a shorter or lower-resolution label, which is where scan failures start.
Check digits
Code 128 always includes a check character after the data. You never type it; the encoder calculates it, and the scanner verifies it before reporting a result. That makes misreads very unlikely.
Code 39 has no required check digit. The bars themselves are somewhat self-checking, but a damaged label can still decode as a different valid string. If accuracy matters, add a modulo 43 check character and make sure your scanner is set to verify it. Both sides have to agree, because the scanner will otherwise return the extra character as part of your data.
When to use which
Pick Code 128 when:
- you control both ends of the system,
- the data includes lowercase letters or symbols,
- the data is long or mostly numeric,
- you want fewer misreads without extra setup.
Pick Code 39 when:
- a customer, standard or industry requires it,
- you are replacing labels in a system that has always used it,
- you need to read the data with very simple, older equipment.
Code 128 is also the base for GS1-128, the shipping and logistics symbology that carries application identifiers. If you are labeling cartons for a retailer, that is a Code 128 variant rather than a different technology.
Common mistakes
- Forgetting the asterisks in Code 39. The start and stop characters are part of the symbol. Generators add them for you; fonts require you to type them.
- Printing too small. Keep the narrow bar at least about 0.19 mm (7.5 mil) for ordinary scanners, and larger for handheld scanning at a distance.
- No quiet zone. Leave blank space on both sides, at least ten times the narrow bar width for Code 128 and Code 39.
- Low contrast. Dark bars on a white background. Avoid red bars with infrared scanners.
Try both
You can generate either one on this site and compare the width of the same value. The Code 128 generator and the Code 39 generator each give a PNG or SVG download, and Barcode Ready draws the symbol in your browser, so nothing you type is uploaded. If you have a list of values, the bulk barcode generator produces a whole column at once.
Summary
- Default to Code 128.
- Use Code 39 when a standard or existing system asks for it.
- Code 128 is denser and always checked; Code 39 is uppercase-only and check digits are optional.
- Test a printed sample with the actual scanner before running a full batch.