As European Digital Product Passport (DPP), EU Battery Passport and anti-refill wine & cosmetics authentication rollouts converge, engineering teams are replacing proprietary NFC query URLs with GS1 Digital Link URIs secured by NXP NTAG 424 DNA SUN (Secure Unique NFC) cryptographic mirrors. Yet custom encoding scripts routinely break at validation due to off-by-one SDMOffset byte math inside Type 4 NDEF file 0xE104. Generate verified URIs and exact hex offsets instantaneously in our GS1 Digital Link & NTAG 424 DNA offset builder alongside our NTAG 424 DNA SUN authentication guide.

Instead of inventing an ad-hoc URL like https://brand.com/verify?sku=123&sn=456, GS1 Digital Link encodes standard GS1 Application Identifiers (AIs) directly in the HTTPS path and query string:

https://id.example.com/01/09506000134352/21/SN100042?10=L2611&picc=00000000000000000000000000000000&cmac=0000000000000000
Segment GS1 / NFC Role Engineering rule
https://id.example.com Brand resolver domain Keep short (<= 18 chars) to conserve NDEF bytes and speed tap read time
/01/09506000134352 AI (01) 14-digit GTIN Pad EAN-13 (0 + 13 digits) or UPC-A (00 + 12 digits) to 14 digits with valid Modulo-10 check digit
/21/SN100042 AI (21) Serial number Maps 1-to-1 to the serial integer when paired with UHF SGTIN-96
?10=L2611 AI (10) Batch / lot Optional query key-value pair before dynamic mirror parameters
&picc=<32-hex>&cmac=<16-hex> NTAG 424 DNA SUN mirror ASCII hex placeholders overwritten dynamically on every tap by AES-128 hardware

2. Exact byte map inside Type 4 NDEF file 0xE104

When https:// is compressed using NFC Forum URI Identifier Code 0x04, a short-record (SR=1, payload < 256 bytes) NDEF file in NTAG 424 DNA lays out every byte as follows:

Byte offset (Dec / Hex) Field Byte length Value & pitfall
0–1 (0x00–0x01) NLEN 2 B Big-endian length of the NDEF message (5 + URI_body_len)
2 (0x02) Record header 1 B 0xD1 (MB=1, ME=1, SR=1, TNF=0x01 Well-Known)
3 (0x03) Type length 1 B 0x01 (1 byte for "U")
4 (0x04) Payload length 1 B 1 + URI_body_len (includes 0x04 prefix code)
5 (0x05) Record type 1 B 0x55 (ASCII 'U')
6 (0x06) URI prefix code 1 B 0x04 — replaces all 8 characters of https://!
7+ (0x07+) Stripped URI body N B Starts at id.example.com/01/... (offset = 7 + index_after_https)
  • ENC PICCData (SDMOffset): Points to the first '0' of your 32-character picc= placeholder (offset = 7 + strippedUrl.indexOf(piccZeros)).
  • SDMMACInputOffset & SDMMACOffset: Set SDMMACOffset to the first '0' of your 16-character cmac= placeholder; set SDMMACInputOffset equal to SDMOffset (or the start of the query string you want authenticated by AES-128 CMAC) and document that exact range in your verification backend!

3. Pre-encoding checklist before releasing roll orders

  1. Freeze your resolver domain & parameter names (picc / cmac or e / c) before mass key diversification—changing domain length later shifts every SDMOffset byte.
  2. Keep numeric serials compatible with SGTIN-96 (<= 38-bit integer, no leading zeros if round-tripping pure SGTIN-96) whenever items carry dual UHF + NFC tags.
  3. Request physical pre-encoded samples via our NFC smart packaging & tap seals or samples page to verify both iOS Safari and Android Chrome tap latency on your actual packaging.

Frequently asked questions

Why are my NTAG 424 DNA SDMOffset and SDMMACOffset off by 1 or 8 bytes when encoding a URL?

In NFC Forum Type 4 file 0xE104, the URI string does NOT start at byte 0: bytes 0–1 hold the 16-bit NLEN length, bytes 2–6 hold the 5-byte short-record NDEF header (D1 01 [PL] 55 04), and byte 6 (0x04) replaces the 8-character https:// prefix! Therefore, byte offset inside 0xE104 = 7 + UTF-8 byte index after stripping https:// (for payload length <= 255 bytes).

How does a GS1 Digital Link NFC URL map to a 96-bit UHF SGTIN-96 EPC?

Both carry the exact same GS1 keys: Application Identifier (01) holds the 14-digit GTIN (Indicator Digit + GS1 Company Prefix + Item Reference + Modulo-10 Check Digit) and AI (21) holds the item serial number—allowing warehouse UHF portals and consumer smartphone NFC taps to resolve the identical serialized item.

Does a GS1 Digital Link URL with NTAG 424 DNA SUN fit inside NTAG213 or NTAG 424 DNA?

Yes—NTAG 424 DNA provides a 256-byte NDEF file (0xE104), comfortably holding a typical 110–145 byte GS1 Digital Link URL with 32-hex encrypted PICCData and 16-hex CMAC. Remember that NTAG213 (144-byte NDEF) supports plain UID/counter mirroring but does NOT have AES-128 SUN hardware.

Sources & further reading