EPC Encoder Decoder: SGTIN, SSCC, GRAI and GIAI

Encode a GS1 key as an RFID EPC, or decode an EPC from hex, with this EPC encoder decoder: SGTIN-96, SGTIN-198, SSCC-96, GRAI-96 and GIAI-96 from the GS1 EPC Tag Data Standard 2.3. You get the hex, the pure identity and tag URIs, the GS1 element string and every bit labelled, without uploading anything.

With the AIs in brackets: (01) GTIN and (21) serial, (00) SSCC, (8003) GRAI with its serial, or (8004) GIAI.

SGTIN scheme

Automatic uses SGTIN-96 when the serial is a number without a leading 0 below 238, and SGTIN-198 for other serials of up to 20 characters.

The company prefix length is not in the number: take it from your GS1 member organization or the barcode lookup.

SGTIN-96 · filter 3 (Reserved) · 11-digit GS1 Company Prefix · 96 bits

EPC (hex)
3066C4409047E14000001A85
Pure identity URI
urn:epc:id:sgtin:95060001343.05.6789
Tag URI
urn:epc:tag:sgtin-96:3.95060001343.05.6789
GS1 element string
(01)09506000134352(21)6789
Bit breakdown
FieldBitsCountValue
Header00110000830 (SGTIN-96)
Filter01133 (Reserved)
Partition00131 (11-digit company prefix)
GS1 Company Prefix10110001000100000010010000010001111113795060001343
Indicator and item reference0000101705
Serial00000000000000000000000001101010000101386789

Binary

001100000110011011000100010000001001000001000111111000010100000000000000000000000001101010000101

How to Encode or Decode an EPC

Enter the GS1 element string with its company prefix length and filter value to get the EPC, or paste the hex a reader shows to get the GS1 key back.

  1. To encode, type the element string with its AIs in brackets, such as (01)09506000134352(21)6789.
  2. Choose the length of your GS1 Company Prefix and the filter value for the object the tag goes on.
  3. Copy the hex for your tag encoder, or the tag URI for your software.
  4. To decode, open Decode and paste the EPC hex or a tag URI: the GS1 key, the URIs and every field appear.

EPC Schemes This Tool Encodes

It encodes and decodes five of the standard's binary schemes, the ones for trade items, logistic units, returnable assets and individual assets.

The five EPC schemes on this page (TDS Release 2.3, Table 14-1 and section 14.6)
SchemeHeaderGS1 keySerial or reference
SGTIN-9630GTIN (01) with serial (21)Digits only, no leading 0, below 2^38
SGTIN-19836GTIN (01) with serial (21)Up to 20 of the 82 GS1 characters
SSCC-9631SSCC (00)In the SSCC itself
GRAI-9633GRAI (8003) with serialDigits only, no leading 0, below 2^38
GIAI-9634GIAI (8004)Digits only after the company prefix, no leading 0

SGTIN-96 and SGTIN-198

Both carry a GTIN with a serial number and give the same EPC URI. SGTIN-96 fits in 96 bits but holds only numeric serials below 274,877,906,944 without a leading zero; any other serial needs SGTIN-198, which writes up to 20 characters in 7 bits each.

Not on This Page

GRAI-170 and GIAI-202 for alphanumeric serials, SGLN, GSRN, GDTI and the other schemes, and the newer + and ++ encodings of TDS 2.0 are not encoded here. The tool says so when a value needs one of them.

How an RFID EPC Code Is Built

A 96-bit EPC is a row of fields: an 8-bit header that names the scheme, a 3-bit filter, a 3-bit partition, the company prefix, the item or asset reference, and the serial.

The Partition Value

The partition tells a reader how many digits the company prefix has, so it can split the fixed 44 bits of an SGTIN between the prefix and the item reference. A 7-digit prefix is partition 5 (24 bits) and an 11-digit prefix is partition 1 (37 bits).

SGTIN partition table (TDS Table 14-16)
PartitionPrefix digitsPrefix bitsItem reference digitsItem reference bits
0124014
1113727
21034310
3930414
4827517
5724620
6620724

The Filter Value

The filter lets a reader skip tags it does not need, such as cases when it counts single items. The standard asks you to choose the value that describes the object, such as 1 for a point-of-sale trade item, and to use 0, All Others, only when no value fits.

EPC and Barcode: The Same GS1 Key

An EPC carries the same GS1 key as the barcode, minus its check digit, so a tag and a barcode can identify the same item.

The EPC URI leaves out the GTIN's check digit; the decoder calculates it again to give the element string. A GTIN-12 (UPC-A) is written as a 14-digit GTIN with two leading zeros, and its U.P.C. Company Prefix becomes a GS1 Company Prefix one digit longer, with a leading 0.

Check digit calculator works out the check digit of a GTIN, SSCC or GRAI step by step.

Pure Identity URI and Tag URI

The pure identity URI names the object; the tag URI adds what the tag needs to rebuild the bits: the scheme with its size, and the filter value.

  • Pure identity: urn:epc:id:sgtin:95060001343.05.6789, the same for SGTIN-96 and SGTIN-198.
  • Tag URI: urn:epc:tag:sgtin-96:3.95060001343.05.6789, with the scheme and filter 3.
  • Escapes: seven of the 82 serial characters, such as / and %, are written as %2F and %25 in a URI.

GS1 EPC Tag Data Standard Release 2.3, ratified October 2025: the schemes, partition tables and filter values this tool follows.

Why the Company Prefix Length Matters

The EPC splits the GS1 key into the company prefix and the rest, and the number itself does not say where the prefix ends.

The standard notes that this length has to be looked up, for example in a table of company prefixes. Your GS1 member organization gives the length with your prefix; a wrong length still encodes, but to a different EPC from the one other systems expect.

Barcode lookup shows the GS1 Prefix of a number and the member organization that issued it.

Frequently Asked Questions

What Is an EPC on an RFID Tag?

The Electronic Product Code is the identifier written in a tag's EPC memory, defined by the GS1 EPC Tag Data Standard. For GS1 keys it holds the same company prefix and reference as the barcode, as bits a reader returns in hex.

Why Is the GTIN Check Digit Not in the EPC?

The standard leaves it out of the EPC URI and the bits, because it can always be calculated from the other digits. The decoder adds it back in the element string.

When Do I Need SGTIN-198 Instead of SGTIN-96?

When the serial has letters or symbols, starts with a zero, or is 274,877,906,944 or more. Automatic mode picks SGTIN-198 for those serials.

Can This Tool Write an RFID Tag?

No. It gives the hex and the tag URI; your tag printer or encoder software writes them to the tag, and a reader shows the hex to decode here.

Which Filter Value Should I Use?

The one that describes the tagged object in the standard's table, such as 1 for a point-of-sale trade item or 2 for a full case for transport. Use 0, All Others, only when no value fits.

Which Version of the Standard Does It Follow?

The GS1 EPC Tag Data Standard Release 2.3, ratified in October 2025. Every example of its Annex E for these five schemes is checked in both directions.