How to Encode RFID Tags: UHF, HF and NFC Compared

Encoding an RFID chip isn't just pushing…

Home / Guides / How to Encode RFID Tags: UHF, HF and NFC Compared

Encoding an RFID chip isn't just pushing data at it. You have to target the right memory bank first — and UHF, HF and NFC each use a different command with a different parameter structure.

The full sequence: the label feeds in, EPC is written inside the coupling zone, then content prints

The four memory banks on a UHF tag

UHF tags (ISO18000-6C) manage memory in banks, and every write must name one.

CodeBankFull nameContentsFirst block
RReservedReservedKill password (blocks 0–1), access password (blocks 2–3)0
EEPCElectronic Product CodeEPC data, CRC, PC bits2
TTIDTag identifierFactory-programmed unique ID, read-only0
UUSERUser memoryYour own data0
UHF tag memory banks (ISO 18000-6C)RReservedBlocks 0-1 kill password · blocks 2-3 access passwordEEPCFrom block 2 · EPC + CRC + PCTTTIDFrom block 0 · factory serial, read-onlyUUSERFrom block 0 · user data, size depends on chipThe b parameter in UHFW / UHFR is the block number from this table
The start block of each bank decides the b parameter in UHFW / UHFR

Two things trip people up constantly.

First, the EPC bank starts at block 2, not 0. Blocks 0 and 1 hold the CRC and protocol control bits, which the chip maintains itself. User-written EPC data begins at block 2.

Second, the USER bank starts at block 0. Same idea — user memory — completely different address. Mix them up and the write silently fails.

The TID bank is read-only. Any write attempt returns an error. To read a chip's factory serial, use UHFR against bank T.

Writing EPC data: the four UHFW parameters

UHFW a, b, c, d, "data"
ParamMeaningDefaultOptions
aAccess modeHA or H
bStart block2Depends on bank
cByte count12Actual data length
dBank codeER / E / T / U

Writing a 96-bit EPC (12 bytes, i.e. 24 hex characters):

UHFW H, 2, 12, E, "11223344556677889900AABB"

12 is the byte count and corresponds to 24 hex characters. The count and the string length must agree. Specify 12 but supply 20 characters and the write is either truncated or rejected.

Writing to USER memory (start block 0, bank U):

UHFW H, 0, 8, U, "A1B2C3D4E5F60718"

Want confirmation? Use UHFWB

Plain UHFW writes and says nothing. To confirm success you'd have to send a separate UHFR read.

UHFWB folds both into one — it writes and returns the EPC to the host immediately.

UHFWB H, 2, 12, E, "11223344556677889900AABB"

On a production line, prefer UHFWB. The host gets the result without a second command, and you avoid the classic timing bug where the read returns the previous label's data.

Reading tags: UHFR versus UHFQ

UHFR a, b, c, d

Same four parameters, same order: bank, start block, byte count, bank code.

UHFR H, 2, 12, E

Reads 12 bytes from the EPC bank.

If the tag has a read-only EPC (locked at manufacture), UHFR may return nothing. Use UHFQ instead:

UHFQ H, 0, 0

UHFQ exists purely to fetch the EPC identifier. The last two parameters are reserved — pass 0. This is also the fastest way to test whether a chip responds at all, since it performs no write.

HF tags: how HFW works

HF covers two families, ISO14443A and ISO15693. Both use HFW.

HFW f, n, s, [l], "data"
ParamMeaningValues
fTag typeA (ISO14443A) or F (ISO15693)
nStart blockPer tag specification
sByte countActual data length
lLock flagOptional; L locks after writing

ISO14443A example:

HFW A, 0, 47, "|PN7K33DF50501|LT02681730310A1|LS02681730310A1|"

ISO15693 example:

HFW F, 0, 20, "PEASY-MARK-2026-0001"

Treat L with care on ISO15693. Adding it locks the chip permanently after writing, and there is no unlock command. That's a protocol limitation, not a printer limitation.

Read back to verify:

HFR A, 0, 47

Read the HF chip's factory UID:

HFQ A, 0, 0

The UID is burned in at manufacture, globally unique and immutable. For asset tracking and anti-counterfeiting, use the UID as the primary key rather than a business number you wrote yourself — business numbers can collide, UIDs cannot.

NFC tags: how NFCW works

An NFC tag is technically an HF tag, but its data follows NDEF — the NFC Forum standard format that phones understand natively.

NFCW [l], "data"

l is an optional lock flag; data is the payload. NDEF imposes format rules, so arbitrary strings won't work:

PurposeFormatExample
Open a web pageStarts with https://NFCW "https://www.peasymark.com"
Place a callStarts with tel:NFCW "tel:+8612345678900"

A complete job that taps through to a contact page:

SIZE 50 mm, 30 mm
GAP 2 mm
CLS
NFCW "https://www.peasymark.com/en/contact/"
TEXT 10,10,"TSS24.BF2",0,1,1,"Tap to contact us"
PRINT 1

Tap the finished label with a phone. If the browser opens, it worked.

If the phone does nothing, check the format first. Writing www.peasymark.com without the scheme is the single most common cause — phones don't recognise it as a URL.

Side-by-side comparison

UHF (UHFW)HF (HFW)NFC (NFCW)
Tag typeISO18000-6CISO14443A / ISO15693NDEF (over HF)
Read rangeLong (metres)Short (centimetres)Tap-to-read
Bank selectionRequired (R/E/T/U)Not required, block onlyNot required, NDEF format
Lock reversibleYes (UHFG2)ISO14443A yes, ISO15693 noNot recommended
Phone readableMostly noYesNative
Typical useWarehousing, production, assetsAccess control, anti-counterfeit, toolingMarketing, traceability

The selection logic is simple: need a phone to read it? NFC. Need long-range bulk reading? UHF. Neither? HF.

Frequently asked questions

The write succeeded but reading returns nothing

Check the bank code. Writing to U and reading from E returns empty every time.

Then check the byte count. Write 12 bytes, read 8, and the tail is invisible. Read 16 and the extra comes back as padding that looks like corruption.

The EPC length comes out wrong

EPC length must be a whole number of bytes, and in practice should be 12 bytes (96 bits) or a multiple of it. A 10-byte EPC works on some readers and is rejected by others.

Design around 12 bytes / 24 hex characters. It's the most compatible choice.

Can a locked ISO15693 tag be recovered?

No. Once HFW F, ..., L executes, the tag is permanently read-only. No command reverses it.

This is why L belongs at the final delivery step only. Lock during production and you scrap the batch.

Can one tag hold both UHF and HF data?

No. UHF and HF are separate chips on separate antennas operating at different frequencies. Dual-frequency tags exist but need dedicated equipment to program each side.

To read both, use two labels or a genuine dual-frequency inlay.

What's the difference between UID and EPC?

The UID is burned into the chip at manufacture, lives in the TID bank and can never change.

The EPC is written by you and can be rewritten indefinitely.

For asset tracking, key on the UID and store business data in the EPC.

Need a hand?

Tell us your tag model and what the data is for, and we'll help you get the command right.

Contact us

Related guides

Need help choosing a printer?

Tell us your label size, print volume and environment — we will recommend the right model and settings.

Request a Quote