Code 128

Read, write, and detect over 30 different barcodes with our barcode SDK.

Code 128

Code 128 is a linear, high-density barcode used for encoding alphanumeric data, which is defined by ISO/IEC 15417:2007. The “128” in this code’s name indicates its ability to encode all 128 ASCII characters. It was originally created as 7-bit ASCII code for this purpose. In the 2007 update to the ISO-15417 specification, however, a method was described which allowed the encoding of ASCII values between 128-255, also known as “extended character set data.”


While there’s no maximum length for this barcode, it can be made as long as necessary to include all encoded data. It supports only alphanumeric or numeric information. Similar in structure to Code 39, Code 128 is often the preferred symbology both for its high-density nature and its ability to encode a much larger selection of characters.

Despite its name and its ability to encode all 128 ASCII characters, Code 128 does not have 128 symbols. Instead, it uses 108 symbols: 103 encode data, 3 indicate barcode starts, and 2 specify barcode stops. Code 128 also has seven distinct sections:

  • The Quiet Zone
  • A Start Symbol
  • All Encoded Data
  • The Check Symbol
  • A Stop Symbol
  • The Final Bar 
  • A Second Quiet Zone

The minimum width of both quiet zones is 10x, where “x” is the width of a single data module.

It’s also worth noting that Code 128 contains three distinct subsets for data encoding. Which subset is used depends on the start code, and multiple subsets can be used in a single barcode by leveraging specific “switch” characters. Subsets A, B, and C each encode different data:

  • Subset A – Numeric digits along with uppercase letters, ASCII symbols, and control codes
  • Subset B – Numeric digits, both upper and lowercase letters, ASCII symbols, and control codes

Subset C – Numeric digits only. By compressing two numeric digits into each character, it’s possible to significantly increase code density. In the case of an odd number of digits, a leading “0” is typically encoded.

Common Use Cases

Based on Code 128, the GSN-128 specification – also known as UCC or EAN 128 – is used in global supply chains for both shipping and packaging enterprises to identify container and pallet stock levels. The ability to easily encode significant data across Code 128 barcodes makes it possible to improve inventory tracking and accuracy, which is now essential for organizations to meet just-in-time stocking and shipping goals.

Box Barcode