Code 128Linear (1D)Introduced 1981

Code 128B

Code 128 locked to code set B — the full printable ASCII range including lowercase letters.

Code 128B Specification

Character setFull printable ASCII 32-127: digits, upper and lowercase letters, punctuation, and space
Data lengthVariable; no fixed minimum or maximum
Check digitMandatory Mod 103 check character, appended automatically
Density≈12 characters per inch at the minimum 0.19 mm X-dimension
Module width (X-dimension)0.19-0.50 mm typical
Print ratioVariable-width bars and spaces
MagnificationScales linearly with the chosen X-dimension
Quiet zone10X on each side
StandardISO/IEC 15417
OriginTed Williams, Computer Identics, 1981
Sample dataHello World!

Try It: Generate a Code 128B Barcode

This live generator is preconfigured for Code 128B. Adjust size, colors, and text — then download as PNG or SVG. Free, no signup, all encoding happens in your browser.

Open the full Code 128B generator →

What Is Code 128B?

Code 128B is Code 128 restricted to code set B, which covers ASCII values 32-127: all printable characters including lowercase a-z, uppercase A-Z, digits, and punctuation. It is the go-to locked subset for alphanumeric data that mixes upper and lower case but contains no control characters and little or no long numeric runs.

Code set B is the most commonly used single subset because human-readable identifiers — names, e-mail-like codes, license keys — live in the printable ASCII range. Compared with Code 39, Code 128B encodes the same alphanumeric content in roughly 60-70% of the width, while also carrying a mandatory check digit that Code 39 lacks.

Common Applications

  • Mixed-case alphanumeric identifiers
  • License keys and serial numbers with letters
  • General labeling where control characters never occur

Code 128B FAQ

What is the difference between Code 128B and Code 128 auto?

Code 128B stays in code set B for the entire symbol. Code 128 auto starts in whichever subset fits and may shift — for example into code set C for a long digit run — to compress the symbol. For typical mixed-case text both produce nearly identical output; auto is preferable when the data may contain long numeric sequences.

Can Code 128B encode an ASCII DEL or control character?

No. Code set B tops out at ASCII 127 and excludes control characters below 32. Data containing control characters requires code set A or the FNC4 shifting mechanism of full Code 128 — in practice, use Code 128 (auto), which handles this automatically.