EPC SGTIN-96 Encoder / Decoder

24 hex characters in, GTIN-14 + serial out — or the reverse. Header byte, partition table, and GS1 check digit are validated.

Header (SGTIN-96)
0x30
Filter
3
Partition
5
GS1 Company Prefix
0614141
Item Reference (with indicator)
812345
Serial
6789
Reconstructed GTIN-14
80614141123458
Bit layout
Header (8 b)00110000
Filter (3 b)011
Partition (3 b)101
Company prefix (24 b)000010010101111011111101
Item reference (20 b)11000110010100111001
Serial (38 b)00000000000000000000000001101010000101

How SGTIN-96 works

An EPC (Electronic Product Code) is a 96-bit identifier stored on every EPCglobal / ISO 18000-63 UHF tag. The most common encoding is SGTIN-96 — Serialized Global Trade Item Number — which combines your GS1 company prefix, a product item reference, and a per-item serial number into 96 bits. The layout is fixed by GS1's EPC Tag Data Standard: 8 bits of header (0x30 for SGTIN-96), 3 bits of filter (packaging level: item, case, pallet…), 3 bits of partition (chooses how the remaining bits split between company prefix and item reference), then the partition-defined company prefix and item reference, and finally a 38-bit serial (0 to 274 billion). The partition table is the tricky part: partition 5 means "7-digit company prefix + 6-digit item reference", partition 6 means "6-digit prefix + 7-digit item reference", and so on. Encoding starts from your GTIN-14: strip the check digit, split it into company prefix + item reference at the length GS1 assigned you (typically 7-10 digits of prefix), pick the matching partition row, and pack the numeric values into their bit widths, big-endian. Decoding reverses that: read the partition, read the correct number of bits, convert to decimal, and re-attach the recomputed GS1 check digit to display a human-readable GTIN. This tool does both, validates the header byte, and shows the bit layout so you can double-check against your printing template.

Partition table

PartitionCompany prefix bitsCompany prefix digitsItem ref bitsItem ref digits
0401241
1371172
23410103
3309144
4278175
5247206
6206247

FAQ

What's the header byte for SGTIN-96?

0x30. Other schemes: 0x35 = SGTIN-198 (up to 20-char alphanumeric serial), 0x2F = SSCC-96, 0x2D = GID-96.

How do I know which partition to use?

It's set by the length of your GS1 company prefix. A 10-digit prefix = partition 2 (34 bits company + 10 bits item ref). A 7-digit prefix = partition 5. Check GS1 for your assigned length.

What's the filter value for?

Packaging level. 0 = all others, 1 = point-of-sale item, 2 = case, 3 = reserved, 4 = inner pack, 6 = unit load, 7 = component / not-for-sale. Retailers standardise on filter=1 for individual retail items.

Why does the serial max out at ~274 billion?

38 bits of serial → 2³⁸ - 1 = 274,877,906,943 unique serials per (company prefix, item reference) pair.