GS1-128 Generator

Supply chain barcode (formerly UCC/EAN-128) that encodes GS1 application identifiers on logistics labels.

How GS1-128 is structured

GS1-128 is Code 128 carrying GS1 data. An FNC1 character in the first position marks the symbol as GS1 rather than plain Code 128, and further FNC1 characters separate variable-length fields inside it. Application identifiers prefix each field — (00) for the 18-digit SSCC, (01) for the GTIN, (17) for an expiry date, (10) for a batch — and are printed in parentheses for people but encoded only as data, so the parentheses are never bar patterns.

GS1-128 check digit

The Code 128 mod-103 check character is present as always, and GS1 adds field-level checks on top: the GTIN under (01) and the SSCC under (00) both end in a mod-10 check digit computed across their data digits. A symbol can therefore be structurally valid and still be rejected on a field whose check digit is wrong.

GS1-128 compared with Code 128

Plain Code 128 carries the same bars with no GS1 semantics, so a reader returns whatever text was encoded. GS1 DataBar Expanded shares the application identifier syntax but is an item-level, point-of-sale symbol; GS1-128 is the case and pallet label used further up the supply chain. Compare the Code 128 generator page for the same breakdown of structure, check digit and use cases.

Common GS1-128 problems

Parentheses were encoded as data

The brackets are presentation only. Encoding them literally puts two characters into every field and shifts every separator after them, so the reader returns a string that no GS1 parser accepts. Feed the data as AI plus value pairs.

A variable-length field was not terminated

Fields such as (10) batch have no fixed length, so an FNC1 separator must follow them when another field comes after. Without it, the reader swallows the next field into the batch value — a common cause of a batch number that arrives with a date appended.

Field contents do not match the AI definition

(17) wants six digits of date and (310n) wants six digits with a fixed number of decimal places. A field that is a digit short misaligns everything that follows, so validate each AI's length before generating rather than after scanning.

Where GS1-128 is used

Not sure this is the right symbology? The barcode format guide groups every supported 1D and 2D format by industry with its character set and limits.