Barcode Ready
← Barcode Guides

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 39Code 128
Characters43: A-Z, 0-9, space and - . $ / + %All 128 ASCII characters, including lowercase and control codes
Start/stopAsterisk (*) at both endsDedicated start and stop patterns
Check digitOptional (modulo 43)Always present (modulo 103)
Numeric densityOne digit per characterTwo digits per character in subset C
Typical lengthShort to mediumShort 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:

Pick Code 39 when:

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

  1. 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.
  2. 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.
  3. No quiet zone. Leave blank space on both sides, at least ten times the narrow bar width for Code 128 and Code 39.
  4. 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

Try it