GS1-128 Barcode Decoder
Parse GS1-128 application identifiers out of a barcode data string.
This bench is being wired up
The gs1-128-decoder decoder is on the roadmap. The heavier binary and cryptographic parsers ship after the core text and token decoders — all of which are already live and working.
Browse the live decodersInput is processed on your device. Nothing you paste is sent anywhere.
What is the GS1-128 Barcode Decoder?
A GS1-128 decoder splits a barcode data string into its Application Identifiers — two- to four-digit codes such as (01) for GTIN, (10) for batch and (17) for expiry — and the value that follows each one.
GS1-128 carries structured data rather than a single number. Each field opens with an Application Identifier that defines what the field means and how long it is: (01) is a 14-digit GTIN, (17) a 6-digit expiry date as YYMMDD, (10) a variable-length batch or lot, (21) a variable-length serial number, (00) an 18-digit SSCC identifying a logistics unit.
The fixed-versus-variable distinction is the whole parsing problem. Fixed-length AIs can simply be read off in sequence, but a variable-length field runs until a GS separator character (ASCII 29) or the end of the string. Miss a separator and every field after it is misread — the usual cause of a pallet label that scans but produces nonsense.
This is the encoding behind pharmaceutical serialisation, food traceability and logistics labels, where a single scan must yield product, batch, expiry and serial at once.
GS1-128 Barcode Decoder at a glance
- (01)
- GTIN — 14 digits, fixed length
- (17)
- Expiry date, YYMMDD, fixed length
- (10) / (21)
- Batch / serial — variable length, GS-terminated
- Separator
- GS character, ASCII 29, ends variable fields
How to use the GS1-128 Barcode Decoder
- 1Paste the raw scanned data string, keeping any GS separator characters intact.
- 2Read each identified Application Identifier and its decoded value.
- 3Check that variable-length fields terminated where you expected them to.
When you would reach for it
- Debugging a warehouse scanner that misreads pallet labels.
- Verifying pharmaceutical serialisation data on a printed carton.
- Extracting batch and expiry data for a traceability system.
GS1-128 Barcode Decoder — frequently asked questions
Last reviewed · questions or corrections: contact@decoder.tools