RFID Technology
RFID Data Encoding and Memory Structures
Quick answer
RFID tags store data in strict layouts: MIFARE Classic 1K packs 1,024 bytes into 16 sectors, NTAG stacks 4-byte pages, EPC Gen2 uses four UHF banks. Learn the floor plan — sector trailers, NDEF containers, Protocol Control words — and you get reliable reads and fewer bricked tags. Skip it, and you manufacture gibberish at scale.
- Learn the floor plan before you write: MIFARE Classic 1K is 16 sectors × 4 blocks × 16 bytes with a lockable trailer in every sector; NTAG213/215/216 stack 4-byte pages holding 144 to 888 bytes of user memory.
- NDEF is the universal lunchbox: one TLV-wrapped container (start byte 0x03, terminator 0xFE) for URLs, text, MIME and smart-poster payloads that every NFC-compliant tag understands.
- EPC Gen2 (UHF) tags use a four-bank floor plan — Reserved, EPC, TID, User — each with its own locks and its own job; both passwords in Bank 0 are 32 bits, and 'irrevocable' on the kill command is not a figure of speech.
At a glance
Use these short answers to decide whether this page matches the project before moving into the detail.
Key takeaway
Learn the floor plan before you write: MIFARE Classic 1K is 16 sectors × 4 blocks × 16 bytes with a lockable trailer in every sector; NTAG213/215/216 stack 4-byte pages holding 144 to 888 bytes of user memory.
How does HF tag memory work in MIFARE and NTAG architectures?
High-frequency (13.56 MHz) tags from the MIFARE and NTAG families keep their memory in strict grids — pages or sectors, addressed right down to the byte. Think of it as...
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 keep their memory in strict grids — pages or sectors, addressed right down to the byte. Think of it as a studio apartment with an aggressively opinionated landlord: there is a place for everything, and if you rearrange the wrong shelf, the whole unit locks and nobody gets the deposit back. Learn the floor plan before you write, and you won't trample the system areas or the lock bits.
MIFARE Classic 1K splits its 1,024 bytes into 16 sectors, each holding 4 blocks of 16 bytes. The last block of every sector is the sector trailer — home to two authentication keys (Key A and Key B) plus the access-condition bits. Scribble on that trailer without understanding the access-bit format and you can permanently lock the sector. There is no undo, no 'are you sure?' — just a small ceramic tombstone where your data used to be.
NTAG213/215/216 take the page-based route — 4 bytes per page, with user memory running from 144 bytes (NTAG213) up to 888 bytes (NTAG216). Pages 0–1 carry the UID, page 2 holds the lock bits and the capability container, and the middle pages store your actual data. The last 5 pages keep the dynamic lock bits, a mirror configuration, authentication settings and a password — the tag's back office, basically.
- Read the capability container (CC) first. Before writing NDEF data, check the CC page — it declares the tag's memory size, read/write access and NDEF version. It is the tag telling you its own house rules.
- Change the default keys. MIFARE Classic Key A ships as FF FF FF FF FF FF on blank cards. Rotate both keys immediately in production — leaving the default is the digital equivalent of taping your PIN to the card.
- Passwords are not encryption. NTAG password protection (32-bit password + 16-bit PACK) gates write access, but the data sitting at rest is not encrypted. Treat it as a doorknob lock, not a vault.
How do NDEF record structure and encoding work?
NDEF (NFC Data Exchange Format) is the standard container for structured data on NFC tags — every NFC-compliant chip (NTAG, MIFARE, DESFire, ST25) speaks it as its common tongue. It is the reason your phone knows what to do when it taps a random sticker, instead of staring at raw bytes and shrugging.
The message rides inside a TLV (Type-Length-Value) wrapper: a type byte 0x03 announces "NDEF message coming through," followed by the length and then the records. A terminator TLV (0xFE) politely says that's all, folks. You can assemble this by hand via APDU or raw page writes — and you can also cut your own hair with kitchen scissors. For anything shipping to production, reach for a library like NDEF.js or ndeflib (Python) and skip the one-wrong-byte afternoon.
| 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 tags that follow ISO 18000-6C (EPC Gen2) divide memory into four banks, each with a distinct role in supply-chain and asset-tracking life. Think of it as a very small building with four tenants who mostly keep to themselves.
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) carries the manufacturer's chip identifier and model number; it is factory-programmed and read-only, so no, you can't edit it — and yes, that's the point. Bank 3 (User) offers optional writable memory for application-specific data, anywhere 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). Order matters — the reader trusts the map, not the territory.
- Never ship the default kill password. Leaving Bank 0 at 0x00000000 in production means anyone can silence your tags. Set it, record it and guard it — it is the tag's self-destruct button.
- User memory is not guaranteed. Low-cost tags may have zero User bank. Verify the datasheet before you architect anything that leans on Bank 3.
- Lock what matters. Access-password protection can lock individual memory banks against unauthorized reads or writes — use it deliberately, per your threat model.
Where are encoding best practices for B2B used?
Data-encoding errors are among the most common causes of RFID project failure — and nearly all of them are catchable at the bench, long before they graduate into a field recall. 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. The practices below are cheap insurance: they turn encoding into the stage where you catch problems, not the stage where you quietly manufacture them by the thousand.
- Verify every write. Read the tag back and compare byte-for-byte against the intended payload. Trust, but memcmp.
- Add checksums or CRCs to user-data payloads so you can detect corruption from RF interference or a partial write — before the reader downstream does.
- Cap your retries. Retry encoding with a maximum attempt count; if a tag fails after 3 attempts, divert it for quality inspection rather than fighting it.
- Budget for overhead. For multi-record NDEF messages, keep total payload under available user memory minus TLV overhead (typically 4–6 bytes). Those bytes are not optional.
- Version your schema. Stamp the encoding schema version in the first bytes of user data so future readers can detect the format and handle migrations gracefully.
How do you plan RFID tag memory capacity?
Choosing a 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 rules of thumb below 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 runs 200–400 bytes — reach for an NTAG216 (888 bytes).
- MIFARE Classic 1K gives you 752 bytes of usable data across 16 sectors once the sector trailers are reserved — good for transit or loyalty applications with structured records.
- DESFire EV2/EV3 with 8 KB supports multi-application deployments — separate files for access control, transit, cashless payment and loyalty data, all on one card.
Inside the EPC Gen2 memory banks bit by bit
UHF supply-chain projects almost always live or die on Bank 1 (EPC) layout decisions. That 96-to-496 bit field is the single most contested piece of real estate on the whole tag, and getting the encoding right the first time saves eye-watering re-tagging later. The detail below distills the public GS1 EPC Tag Data Standard plus how retail and logistics deployments actually use it.
- Bank 1, from the top. The first 16 bits are a CRC-16 used for air-interface error detection — the chip computes it automatically, so hands off. The next 16 bits are the Protocol Control (PC) word, which encodes the EPC length in its top 5 bits, the 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 (totes, reels, containers); GLN-96 covers fixed locations; 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. That way lies duplicate-identity chaos.
- 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.
- Rule of thumb: identity lives in Bank 1, proof lives in Bank 2, breadcrumbs live in Bank 3 — and the full story stays in your ERP, where storage is free and nobody's read range suffers.
Encoding workflow and toolchain across MIFARE, NTAG, DESFire, and Gen2
Every RFID program needs a repeatable encoding pipeline: take blank inventory, write the right data, verify the result, and ship only the 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 fails and the reader returns an error code. On well-designed tags the existing data is preserved — no harm done. Some tags, however, can end up in an inconsistent state if a multi-page write is interrupted mid-flight, so always verify data integrity after write operations. The tag will not politely expand to fit; it is not a moving box.
Can I store encrypted data on an NFC tag?
Yes. Encrypt the payload before writing it, using any symmetric or asymmetric algorithm you like. The tag simply stores the ciphertext as raw bytes in an NDEF External Type or MIME record — it neither knows nor cares that it is encrypted. 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 — more than enough for the vast majority of applications. If your use case genuinely needs millions of writes, look at FRAM-based tags or DESFire cards with wear-leveling.
What is the difference between NDEF and raw memory access?
NDEF is a standardized format that every NFC-compliant device can read — the lingua franca. Raw memory access writes arbitrary bytes straight to tag pages or sectors, which then requires a custom reader application to interpret. Use NDEF for interoperability; use raw access for proprietary data structures where you need maximum memory efficiency and control the reader anyway.
How do I pick between encoding the EPC at the chip versus printing on the label face?
In a well-run UHF program, both — encoded together on the same pass. The EPC written to Bank 1 is the machine-readable identity RFID readers use; 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 text on the same pass that encodes the chip, verifying both before the label leaves the printer. The cost premium for combined print-and-encode is small next to the value of 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, 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 — a server-side identifier can be revoked instantly, while a value baked onto a tag cannot. Third, modern tap-to-action workflows route through a server anyway for personalization, A/B testing, and analytics, so 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.
