# GS1-128 Barcode Decoder

> Parse GS1-128 application identifiers out of a barcode data string.

- Page: https://decoder.tools/gs1-128-decoder
- Category: Identification & Serials
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

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.

## Example

```text Input
(01)09501101530003(17)261231(10)AB-123(21)12345
```

```text Output
(01) GTIN: 09501101530003  [check digit valid]
(17) Expiration date: 2026-12-31
(10) Batch or lot number: AB-123
(21) Serial number: 12345
Elements: 4
Validation: ✓ all elements valid
```

## What is the GS1-128 Barcode Decoder?

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.

## How to use the GS1-128 Barcode Decoder

1. Paste the raw scanned data string, keeping any GS separator characters intact.
2. Read each identified Application Identifier and its decoded value.
3. Check that variable-length fields terminated where you expected them to.

## When to use 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 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 |

## FAQ

### What are the brackets in a GS1-128 code?

A human-readable convention only. The parentheses around an AI are printed under the barcode for people to read; they are not part of the encoded data.

### Why does my scan produce garbled fields?

A missing GS separator after a variable-length field. Without it the parser keeps consuming digits into the next AI, and everything downstream is wrong.

### What is an SSCC?

Serial Shipping Container Code, AI (00) — an 18-digit identifier for a logistics unit such as a pallet, unique enough to track that specific unit through a supply chain.
