- Home
- Barcode Glossary
- Code 128B
Code 128B
Code 128 locked to code set B — the full printable ASCII range including lowercase letters.
Code 128B Specification
| Character set | Full printable ASCII 32-127: digits, upper and lowercase letters, punctuation, and space |
| Data length | Variable; no fixed minimum or maximum |
| Check digit | Mandatory 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 ratio | Variable-width bars and spaces |
| Magnification | Scales linearly with the chosen X-dimension |
| Quiet zone | 10X on each side |
| Standard | ISO/IEC 15417 |
| Origin | Ted Williams, Computer Identics, 1981 |
| Sample data | Hello 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.
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
Related Barcode Types
A high-density, variable-length linear barcode that encodes all 128 ASCII characters, and the backbone symbology of modern logistics.
Code 128 locked to code set A — uppercase letters, digits, and ASCII control characters.
Code 128 locked to code set C — digit pairs packed two per character for maximum numeric density.
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.
