Barcodian

What Is Code 128?

Share

Definition

Code 128 is a high-density 1D barcode that can encode all 128 ASCII characters (digits, upper/lowercase letters and symbols). It takes its name from the 128 characters it can encode.

Unlike types such as EAN/UPC that carry only fixed-length digits, Code 128 can carry variable-length, alphanumeric data, making it very flexible. That's why it's so common in logistics and inventory.

To check a Code 128 value's character set and printability, use the Code 128 validator.

Character sets (A, B, C)

Code 128 has three subsets: Set A encodes control characters and uppercase, Set B all printable ASCII (upper/lowercase, symbols), and Set C digit pairs only.

Set C encodes digit-only data two digits per module, noticeably shortening the barcode. A good encoder switches between these sets automatically based on the data to produce the most compact result.

This flexibility lets the same information be carried in the narrowest possible barcode, which matters on narrow labels and where space is tight.

Where it's used

Code 128 is common on shipping and freight labels, warehouse shelf and location codes, internal inventory tracking and serial-number labels. It's also often chosen to turn alphanumeric SKUs into barcodes.

While a retail shelf barcode (EAN-13) identifies the individual product, Code 128 mostly carries a business's own internal tracking data. The two can be used together for different purposes.

To produce a Code 128 barcode, enter the value in the barcode generator; for internal stock codes, the SKU generator may help first.

Limits and cautions

Code 128 supports only ASCII characters; non-English letters such as ş, ğ, ç, ı cannot be encoded with standard Code 128. If your value contains them, convert to ASCII equivalents.

As length grows, the barcode physically widens; very long values may not fit a narrow label or may scan poorly because the module width shrinks. Aim for a length appropriate to your label size.

Hidden spaces and invisible characters in copied data can cause problems; you can strip them with the barcode normalizer.

Relationship to GS1-128

GS1-128 is a special variant that adds an Application Identifier (AI) structure on top of the Code 128 symbology. With it, a single barcode can carry multiple data — GTIN, lot number, expiry date.

To parse GS1-128 element strings, use the GS1-128 parser. For a conceptual explanation, see what is GS1-128.

In short, every GS1-128 is a Code 128, but not every Code 128 is a GS1-128; the difference is whether the data is structured with AIs.

This tool generates, reads and validates barcode and QR code data technically. It does not issue official GS1 numbers and does not verify product registration or brand ownership. A valid check digit does not mean the product is real or registered.