EPC Encoding
How UHF RFID tags store identity: from raw hex to human-readable URIs.
What is an EPC?
An Electronic Product Code (EPC) is the data stored in the memory of a UHF RFID tag. It is a binary-encoded identifier - typically 96 bits - that uniquely identifies a physical object. The EPC system is defined by the GS1 EPC Tag Data Standard (TDS), currently at Release 2.3 (October 2025).
Unlike a barcode, which identifies a class of product (every bottle of the same water has the same barcode), an EPC identifies a specific individual item. Two identical bottles have the same GTIN but different EPCs.
How encoding works
Every EPC starts with an 8-bit header that tells you the encoding scheme. The header determines:
- Which type of identifier is encoded (product, location, asset, document, etc.)
- The total bit length of the EPC
- The exact field layout - where each field starts and ends
After the header, most schemes contain a 3-bit filter (packaging level metadata), a 3-bit partition (determines field widths), then the actual identity fields.
The four identity layers
The same identity exists at four levels, each adding or removing encoding detail:
The actual bits on the tag. Example: 3074257BF7194E4000001A85
Includes encoding metadata (filter, bit length). Example: urn:epc:tag:sgtin-96:3.0614141.812345.6789
Abstract identity - no encoding details. Example: urn:epc:id:sgtin:0614141.812345.6789
The barcode equivalent. Example: GTIN 80614141123458 + Serial 6789
The partition table
GS1 assigns company prefixes of different lengths (6–12 digits). In binary, fields must be fixed-width. The partition value (3 bits, values 0–6) tells the decoder how to split the bits between the company prefix and the following reference field.
Without the partition, you cannot decode the EPC - you would not know where the company prefix ends and the item reference begins. Each scheme has its own partition table; see the individual scheme pages for the full tables.
Filter values
The 3-bit filter field indicates the packaging level or category of the tagged item. It appears in the Tag URI but not the Pure Identity URI - it is encoding metadata, not identity.
Crucially, each scheme defines its own filter table. SGTIN filter 1 means "POS trade item". SGLN filter 1 is reserved. GRAI filter 1 means "rail vehicle". The header byte determines which filter table to use. See the scheme reference pages for complete filter tables.
EPC schemes
The header byte identifies one of 20 encoding schemes. Each encodes a different type of GS1 key (or non-GS1 identifier) with a specific field layout.
Trade items
Logistics
Assets
Working with 96-bit values in code
A 96-bit EPC exceeds JavaScript's Number.MAX_SAFE_INTEGER (253 - 1). If you parse hex with Number('0x3074257BF7194E4000001A85'), you lose precision silently.
Use BigInt instead:
const epc = BigInt('0x3074257BF7194E4000001A85')
// Extract header (top 8 bits of 96)
const header = Number((epc >> 88n) & 0xFFn) // 0x30 = 48 = SGTIN-96Source
All encoding definitions on this page are sourced from the GS1 EPC Tag Data Standard, Release 2.3, ratified October 2025.