NDEF, the NFC Data Exchange Format, is the NFC Forum's standard for structuring data on a tag. A phone reads NDEF and nothing else by default, so a tag holding raw bytes in any other arrangement will be detected and then ignored.
A URI record, byte by byte.
| Record type | Well Known Type 'U' (URI) |
|---|---|
| First payload byte | An identifier code that stands in for a common prefix |
| 0x01 | http://www. |
| 0x02 | https://www. |
| 0x03 | http:// |
| 0x04 | https:// |
| Remaining bytes | The rest of the URL as UTF-8 |
The prefix byte is not decoration. Writing https:// as an identifier code instead of eight literal characters saves seven bytes on every tag, which mattered a great deal more when tags held 48 bytes than it does at 144.
Where this shows up.
Every free NFC-writing app produces NDEF, which is why writing a tag takes seconds and needs no technical knowledge. Knowing the format exists is what lets you diagnose the one failure that looks inexplicable: a tag your phone detects and then does nothing with.
The common mistake.
Assuming a tag that does not open anything is broken. Far more often it holds either no NDEF record at all, or a record whose type the phone does not act on automatically. Rewrite it as a URI record and it works.
Sources.
Every figure above is from one of these. They are the standard, the registry or the platform’s own documentation — read them rather than take our word for it.
- NDEF and Record Type Definition specifications NFC Forum
- NFC basics: reading NDEF from a tag Android Developers
- Near-field communication Wikipedia