RFID Technology
RFID Data Encoding and Memory Structures
Quick answer
A technical primer on how data is organized, encoded and stored in RFID tag memory. Covering NDEF formatting, MIFARE sector layouts, EPC memory banks and encoding best practices for B2B integrators building read/write RFID applications.
- Understanding RFID memory architecture prevents data corruption, improves read reliability and enables efficient utilization of limited tag memory.
- NDEF (NFC Data Exchange Format) provides a standardized container for URLs, text, MIME records and smart-poster payloads across all NFC-compliant tags.
- EPC Gen2 (UHF) tags use a four-bank memory model (Reserved, EPC, TID, User) each with different access permissions and use cases.
At a glance
Use these short answers to decide whether this page matches the project before moving into the detail.
Key takeaway
Understanding RFID memory architecture prevents data corruption, improves read reliability and enables efficient utilization of limited tag memory.
How does HF tag memory work in MIFARE and NTAG architectures?
High-frequency (13.56 MHz) tags from the MIFARE and NTAG families organize memory into pages or sectors with byte-level addressing. Understanding the specific layout is...
Next step
Ready to move forward? Start your inquiry to get specific answers for this project.
Get encoding supportHow does HF tag memory work in MIFARE and NTAG architectures?
High-frequency (13.56 MHz) tags from the MIFARE and NTAG families organize memory into pages or sectors with byte-level addressing. Understanding the specific layout is essential for writing data without overwriting system areas or lock bits.
MIFARE Classic 1K divides its 1 024 bytes into 16 sectors, each containing 4 blocks of 16 bytes. The last block of each sector is the sector trailer, containing two authentication keys (Key A and Key B) and access condition bits. Writing to the sector trailer without understanding the access-bit format can permanently lock the sector.
NTAG213/215/216 use a page-based architecture with 4 bytes per page. User memory ranges from 144 bytes (NTAG213) to 888 bytes (NTAG216). Pages 0–1 contain the UID, page 2 holds lock bits and the capability container, and the remaining pages store user data. The last 5 pages hold dynamic lock bits, a mirror configuration, authentication settings and a password.
- Always read the capability container (CC) page before writing NDEF data. It defines the tag's memory size, read/write access and NDEF version.
- MIFARE Classic Key A defaults to FF FF FF FF FF FF on blank cards. Change both keys immediately in production to prevent unauthorized access.
- NTAG password protection (32-bit password + 16-bit PACK) restricts write access but does not encrypt data at rest.
How do NDEF record structure and encoding work?
NDEF is the NFC Forum's standard format for storing structured data on NFC tags. Every NFC-compliant tag — NTAG, MIFARE, DESFire, ST25 — uses NDEF as the interoperable data container.
The NDEF message begins with a TLV (Type-Length-Value) wrapper: type byte 0x03 identifies an NDEF message, followed by the length and the NDEF records. The message ends with a terminator TLV (type 0xFE). Writing NDEF data directly via APDU or page writes requires constructing the full TLV structure; using a library such as NDEF.js or ndeflib (Python) is strongly recommended.
| NDEF record type | TNF + Type | Typical payload | Memory usage |
|---|---|---|---|
| URI | TNF=0x01, Type='U' | URL with protocol prefix code | 5–100 bytes |
| Text | TNF=0x01, Type='T' | UTF-8 or UTF-16 string with language code | 10–200 bytes |
| Smart Poster | TNF=0x01, Type='Sp' | Nested URI + Title + Action records | 50–300 bytes |
| MIME | TNF=0x02, Type='application/...' | vCard, JSON, binary blob | Variable |
| External Type | TNF=0x04, Type='domain:type' | Application-specific payload | Variable |
How does the UHF EPC Gen2 memory model work?
UHF RFID tags conforming to ISO 18000-6C (EPC Gen2) organize memory into four banks, each serving a distinct purpose in supply-chain and asset-tracking applications.
Bank 0 (Reserved) stores the kill password and access password. Both 32 bits. Bank 1 (EPC) holds the Electronic Product Code, typically 96 bits but extendable to 496 bits. Bank 2 (TID) contains the tag manufacturer's chip identifier and model number. This bank is factory-programmed and read-only. Bank 3 (User) provides optional writable memory for application-specific data, ranging from 0 to 512 bits depending on the chip model.
- EPC Bank 1 structure: CRC-16 (16 bits) + PC (Protocol Control, 16 bits) + EPC (96–496 bits).
- The kill password in Bank 0 should never be left at the default 0x00000000 in production. Set and record it to enable permanent tag decommissioning.
- User memory (Bank 3) availability varies widely. Low-cost tags may have zero user memory. Verify datasheet specifications before designing applications that rely on User bank storage.
- Access-password protection can lock individual memory banks to prevent unauthorized write or read operations.
Where are encoding best practices for B2B used?
Nothing focuses a project team quite like a pallet of freshly encoded tags that all read back as gibberish on the morning of a retailer's compliance deadline. Data-encoding errors are among the most common causes of RFID project failures — and nearly all of them are catchable at the bench, long before they graduate into a field recall. The practices below are the cheap insurance that makes the encoding stage where you catch problems instead of where you quietly manufacture them.
- Always write a verification read after every write operation. Compare the written data byte-for-byte against the intended payload.
- Use checksums or CRCs in user-data payloads to detect memory corruption from environmental RF interference or partial writes.
- Implement encoding retry logic with a maximum attempt count. If a tag fails encoding after 3 attempts, divert it for quality inspection.
- For multi-record NDEF messages, ensure total payload length does not exceed available user memory minus TLV overhead (typically 4–6 bytes).
- Document the encoding schema version in the first bytes of user data so future readers can detect and handle format migrations.
How do you plan RFID tag memory capacity?
Selecting the right tag chip comes down to one unglamorous question: how much data does the application actually need to store? Over-provision and you have gold-plated every tag for capacity nobody will ever write to; under-provision and you are swapping chips mid-project — the expensive way to learn the answer. The capacity rules of thumb below exist to keep you out of both ditches.
- A standard URL (https://example.com/path?id=12345) encoded as NDEF URI uses 40–80 bytes — NTAG213 (144 bytes) is sufficient.
- A vCard with name, company, phone, email and address encoded as NDEF MIME typically uses 200–400 bytes — NTAG216 (888 bytes) is appropriate.
- MIFARE Classic 1K provides 752 bytes of usable data across 16 sectors after reserving sector trailers. Suitable for transit or loyalty applications with structured records.
- DESFire EV2/EV3 with 8 KB supports multi-application deployments with separate files for access control, transit, cashless payment and loyalty data.
Inside the EPC Gen2 memory banks bit by bit
UHF RFID supply-chain projects almost always live or die on Bank 1 (EPC) layout decisions. The 96-to-496 bit EPC field is the single most contested resource in a tag, and getting the encoding right the first time saves expensive re-tagging later. The detail below summarizes the public GS1 EPC Tag Data Standard plus typical retail and logistics deployments.
- Bank 1 internal layout. The first 16 bits are a CRC-16 used for air-interface error detection and are computed automatically by the chip. The next 16 bits are the Protocol Control (PC) word, which encodes the EPC length in the top 5 bits, AFI/UMI flags, and an XPC indicator that signals presence of additional control words. EPC content begins at word 2. Setting the EPC length wrong in the PC word is the most common cause of 'tag reads but encoding looks corrupted' tickets — readers honor the PC word, not the actual EPC content size.
- EPC encoding schemes by use case. SGTIN-96 is the standard for retail item-level tagging (GTIN + serial), GIAI-96 and GRAI-96 cover returnable assets, GLN-96 covers fixed locations, and SSCC-96 covers logistics units (pallets, cases). Walmart's RFID supplier mandate, the FDA Drug Supply Chain Security Act, and most retail item-level programs require SGTIN-96 with a fully-licensed GS1 Company Prefix — never reuse a serial number across the GTIN-prefix space.
- TID bank uniqueness for clone defense. Bank 2 holds a permanent 64-bit (sometimes 96-bit) chip identifier programmed and locked at the foundry. The unique TID combined with the EPC is the basis for most authentication and anti-counterfeit programs (Impinj M775 with M-Series TID Authentication, NXP UCODE 9 / DNA, and others). Use the TID rather than the EPC as the source-of-truth identity if you need to detect cloned tags.
- User memory pricing and physics. User memory in Bank 3 ranges from 0 bits (Impinj M730 / M830 / NXP UCODE 9 base / UCODE 9xe) through 32 bits (M750 / M775 / M850), 64 bits (M770), 128 bits (M780 / Higgs-EC), 512 bits (M781), 688 bits (Alien Higgs-9), 752 bits (NXP UCODE 9xm SL3S1005), and 3,072 bits / 384 bytes (NXP UCODE DNA SL3S5002N0FUD). Impinj Monza X (HF + UHF) historically reached 8 KB. Each additional kilobit of user memory both raises chip cost (often 30-50% per step) and reduces effective read range because the chip draws more power during a write. For most retail and supply-chain applications, prefer to keep static reference data in your back-end ERP and write only a small per-tag pointer or version code into User memory.
- Lock and kill commands. Both the access password and kill password are 32 bits stored in Bank 0. Issuing a Lock command with the appropriate mask makes a memory bank permanently read-only or password-locked. Kill is irrevocable — once the kill command succeeds, the tag is silenced forever. Field crews should never have access to the kill password, and the access password should be diversified per tag (or at least per shipment) so a single compromised handheld cannot lock the entire deployed population.
Encoding workflow and toolchain across MIFARE, NTAG, DESFire, and Gen2
Every RFID program needs a repeatable encoding pipeline that takes blank inventory, writes the right data, verifies the result, and ships only good tags. The toolchain looks slightly different for HF and UHF, but the same five steps apply. The summary below names the libraries, encoders, and quality checks integrators most often use in production. Get the pipeline right and encoding turns into the boring part of the project — which, after living through a field recall or two, is exactly the part every veteran integrator is quietly rooting for.
- Step 1HF (NTAG, MIFARE Classic, DESFire) — desktop encoding toolchain. Use ACS ACR122U or ACR1252U USB readers with PC/SC drivers, NXP TagWriter or NFC Tools for one-off jobs, and ndeflib (Python) or ndef-tools-for-android for programmatic encoding. For production volume above a few thousand cards per day, an XPRINTA, ZEBRA ZXP3, Magicard 600, or Evolis Primacy 2 card printer with built-in HF encoding station is the standard solution.
- Step 2UHF (EPC Gen2) — desktop and inline encoding. Zebra ZT411 RFID, SATO CL4NX Plus, TSC ML240P, and Honeywell PX940 thermal printers all integrate UHF encoders with print-and-encode workflows. For carton-level encoding at the line, fixed Impinj R700 or Zebra FX9600 readers with Atid or Acura applicators encode and verify in motion at 2-3 tags per second. Whatever encoder you pick, capture both the EPC written and the chip TID into your manifest — the TID becomes the audit trail for any later disputes.
- Step 3Verification step. Always read back the tag and compare to the manifest before the tag leaves the encoding station. For HF, a second SCAN compared byte-for-byte to the intended payload. For UHF, an Inventory operation that returns EPC + TID + Read Power. Any mismatch dumps the tag to a reject bin. Skipping verification is the single most common reason field read rates underperform the original spec.
- Step 4Lock policy. Once verified, lock the appropriate memory bank or page. NTAG static lock bits (page 2) prevent further writes to user pages. MIFARE Classic access bits in the sector trailer set per-sector access. DESFire writes are gated by application keys per-file. UHF Gen2 uses the Lock command with a 20-bit mask. Lock policies should be documented in the encoding spec and applied consistently — partial-lock states are a common source of mid-program rework.
- Step 5Encoding throughput planning. Realistic encoding rates for production planning: Card printer with HF encoder ~300-500 cards/hour single station; inline UHF print-and-encode 1,500-3,000 tags/hour single Zebra ZT411; conveyor-based UHF carton encoding 4,000-8,000 tags/hour with quality verification. Build in 5-10% rework buffer. Apparel and beauty programs typically run two encoding lines in parallel rather than push a single line beyond 80% of nameplate.
Useful next pages
Use these linked product, guide and comparison pages to keep the next click specific and practical.
Blank RFID cards for encoding
Blank NFC and RFID cards ready for custom data encoding and NDEF formatting.
RFID encoding hardware
USB readers and writers for encoding NDEF data, MIFARE sectors and DESFire applications.
NFC tags for NDEF encoding
NTAG-based NFC stickers and cards with pre-formatted NDEF capability containers.
Standards and chip references
Authoritative encoding documentation from GS1, NXP, and the NFC Forum.
FAQ
What happens if I write data beyond the tag's memory capacity?
The write command will fail and the reader will return an error code. On well-designed tags, the existing data is preserved. However, some tags may leave the memory in an inconsistent state if a multi-page write is interrupted. Always verify data integrity after write operations.
Can I store encrypted data on an NFC tag?
Yes. You can encrypt your payload before writing it to the tag using any symmetric or asymmetric algorithm. The tag stores the ciphertext as raw bytes in an NDEF External Type or MIME record. The reading application decrypts the data using a shared key or PKI infrastructure.
How many times can I rewrite an NFC tag?
NTAG and MIFARE chips typically support 100 000 write/erase cycles per memory page or block. This is more than sufficient for most applications. If your use case requires millions of writes, consider FRAM-based tags or DESFire cards with wear-leveling.
What is the difference between NDEF and raw memory access?
NDEF is a standardized data format that all NFC-compliant devices can read. Raw memory access writes arbitrary bytes directly to tag pages or sectors, which requires a custom reader application to interpret. Use NDEF for interoperability and raw access for proprietary data structures that need maximum memory efficiency.
How do I pick between encoding the EPC at the chip versus printing on the label face?
In a well-run UHF program both are encoded together. The EPC written to Bank 1 is the machine-readable identity used by RFID readers, and the human-readable code printed on the label face (typically a GS1-128 barcode plus the SGTIN in plain text) is the fallback for any station where RFID is not yet deployed or is temporarily down. Inline thermal printers like Zebra ZT411 RFID, SATO CL4NX Plus, and TSC ML240P print the barcode and human-readable text on the same pass that encodes the chip, with verification of both before the label leaves the printer. The cost premium for combined print-and-encode is small relative to the value of having two independent identification methods on every item.
Should I store sensitive customer data directly on an NFC tag?
No. Even on tags with password or AES protection, you should store an opaque identifier on the chip and keep the personal or sensitive data behind a server lookup. Three reasons. First, regulators (GDPR, CCPA, HIPAA, PCI-DSS) treat data on a physical token as data 'in transit and in storage' that the operator is responsible for protecting. Second, lost tags are a known risk and a server-side identifier can be revoked instantly while a tag-stored field cannot. Third, modern tap-to-action workflows route through a server anyway for personalization, A/B testing, and analytics, so the tag-stored data adds risk without operational benefit. The exception is dynamic-authentication tags such as NTAG 424 DNA, where the cryptographic SUN message is by design ephemeral and verifiable per-tap rather than a static personal payload.
Proud Tek is a Shenzhen-based RFID & NFC manufacturer supplying hotel chains, transit operators, event venues and retail brands worldwide. Every order includes free samples, RF testing and dedicated project support.
Get a Quick Quote
Tell us about your project and we'll respond within one business day. Fields marked (asterisk) are required.
