%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D', 'background': '#ffffff', 'mainBkg': '#2C3E50', 'secondBkg': '#16A085', 'tertiaryBkg': '#E67E22'}}}%%
flowchart TD
MSG[NDEF Message] --> REC1[Record 1<br/>Header + Payload]
MSG --> REC2[Record 2<br/>Header + Payload]
MSG --> REC3[Record 3<br/>Header + Payload]
REC1 --> H1[Header<br/>TNF, Type, ID, Flags]
REC1 --> P1[Payload<br/>URL: https://example.com]
REC2 --> H2[Header<br/>TNF, Type, ID, Flags]
REC2 --> P2[Payload<br/>Text: Hello NFC]
style MSG fill:#2C3E50,stroke:#16A085,color:#fff
style REC1 fill:#16A085,stroke:#2C3E50,color:#fff
style REC2 fill:#16A085,stroke:#2C3E50,color:#fff
style REC3 fill:#7F8C8D,stroke:#333,color:#fff
886 NFC Tags and NDEF Format
886.1 Learning Objectives
By the end of this chapter, you will be able to:
- Understand NFC Tag Types: Compare Type 1-5 tags and choose appropriate types for different applications
- Master NDEF Format: Create and parse NFC Data Exchange Format messages
- Design NDEF Records: Structure URI, text, Smart Poster, and MIME type records
- Optimize Tag Selection: Select tag memory and capabilities based on use case requirements
- Calculate Transfer Times: Estimate data transfer times at different NFC data rates
886.2 Prerequisites
Before diving into this chapter, you should be familiar with:
- NFC Introduction and Operating Modes: Understanding NFC fundamentals, three operating modes, and relationship to RFID
- Networking Basics: Data encoding and protocol concepts
- RFID Fundamentals: Tag types and memory structures
This Series: - NFC Introduction and Operating Modes - NFC fundamentals - NFC Tags and NDEF Format - This chapter - NFC Programming and Applications - Hands-on tag programming - NFC Implementation and Best Practices - IoT integration and Python examples
Related Content: - RFID Tag Types - Parent technology tag types - Data Encoding - Data structure concepts - Protocol Design - Protocol fundamentals
Learning: - Quizzes Hub - Test your NDEF knowledge - Tool Discovery Hub - Interactive NDEF builders
Think of NFC tags like different sizes of sticky notes:
- Type 1-2 tags are like small sticky notes (48-144 bytes) - perfect for a website URL or short message
- Type 4 tags are like index cards (4-32 KB) - can hold more complex data like encrypted payment information
- Type 5 tags are specialized for IoT sensors - like industrial labels with extra range
The NDEF format is like using a standard template for your sticky note so anyone can read it, whether they have an iPhone or Android phone. Without NDEF, it would be like writing in a language only your phone understands!
886.3 NFC Tag Types
NFC tags come in different types with varying memory and capabilities:
| Type | Memory | Speed | Rewritable | Use Case | Example |
|---|---|---|---|---|---|
| Type 1 | 96 bytes - 2 KB | 106 Kbps | Yes | Simple marketing | Topaz |
| Type 2 | 48 bytes - 2 KB | 106 Kbps | Yes | Smart posters | MIFARE Ultralight |
| Type 3 | Variable | 212 Kbps | Yes/No | Transit, eSIM | Sony FeliCa |
| Type 4 | 4 KB - 32 KB | 424 Kbps | Yes | High-security | MIFARE DESFire |
| Type 5 | 256 bytes - 8 KB | 106 Kbps | Yes | IoT sensors | ISO 15693 |
For simple tasks (URL, text): Type 2 (cheap, ~$0.20) For payments, access: Type 4 (secure, encrypted) For IoT sensors: Type 5 (longer range within NFC spec) For read-only: Lock Type 2 after writing
886.4 NDEF (NFC Data Exchange Format)
NDEF is the standard data format for NFC, ensuring interoperability between devices.
886.4.1 NDEF Message Structure
886.4.2 Common NDEF Record Types
URI Record (open URL):
Type: U (URI)
Payload: https://example.com/product/123
Text Record:
Type: T (Text)
Payload: "Tap to connect to Wi-Fi"
Smart Poster:
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#7F8C8D', 'background': '#ffffff', 'mainBkg': '#2C3E50', 'secondBkg': '#16A085', 'tertiaryBkg': '#E67E22'}}}%%
flowchart LR
SP[Smart Poster<br/>NDEF Message]
SP --> URL[URL Record<br/>https://movie.com/trailer]
SP --> TEXT[Text Record<br/>Coming Soon: Movie Title]
SP --> MIME[MIME Record<br/>image/png poster]
style SP fill:#2C3E50,stroke:#16A085,color:#fff
style URL fill:#16A085,stroke:#2C3E50,color:#fff
style TEXT fill:#16A085,stroke:#2C3E50,color:#fff
style MIME fill:#E67E22,stroke:#2C3E50,color:#fff
Wi-Fi Configuration (Android):
Type: application/vnd.wfa.wsc
Payload: [Wi-Fi credentials encrypted]
886.5 Summary
This chapter explored NFC tag types (Type 1-5) with their memory capacities, speeds, and use cases. Type 2 tags are ideal for simple smart posters, while Type 4 tags provide high security for payments. NDEF (NFC Data Exchange Format) ensures cross-platform interoperability by providing a standardized way to structure URLs, text, Smart Posters, and MIME records on NFC tags.
Understanding tag selection and NDEF structure enables you to design NFC solutions that work seamlessly across all NFC-capable devices, from iPhones to Android phones to embedded IoT readers.
886.6 What’s Next
Now that you understand NFC tag types and NDEF format, the next chapter provides hands-on programming examples for reading and writing NFC tags, along with real-world application scenarios.
Continue to: NFC Programming and Applications