Locking and Unlocking UHF Tags: A Guide to UHFG2

UHF tags don't just "take a password". T…

Home / Guides / Locking and Unlocking UHF Tags: A Guide to UHFG2

UHF tags don't just "take a password". They support lock, unlock, permanent lock and permanent unlock — and one of those makes the tag permanently unmodifiable. Know which one you're issuing before you issue it.

What a lock actually does

A UHF tag (ISO18000-6C) divides memory into four banks, each of which can be locked independently:

CodeBankContents
EEPCEPC data
UUSERYour own data
AAccess passwordAccess Password
KKill passwordKill Password

Locking a bank means "this bank can no longer be written". It has no effect on reading — a locked tag reads exactly as before.

That distinction matters. Locking is not encryption. It only prevents writing; any compliant reader can still read the contents.

Three lock states on a UHF tag — only one is irreversible1UnlockedReadable and writable—2LockedRead-only, reversibleL lock / U unlock3PermalockedRead-only, irreversibleP permalockP cannot be undone — always test on a sample label before mass production
L is just read-only and U can undo it; P is a fuse — once blown, there is no way back

The five UHFG2 actions

UHFG2 E, L, "00000000"

Structure: UHFG2 bank, action, "password"

ActionMeaningReversible
UUnlockYes — can be locked again
LLockYes — can be unlocked
OPermanent unlockNo — can never be locked again
PPermanent lockNo — can never be unlocked
SChange password— (bank A only)

O and P are irreversible. Once issued, the bank's lock state is fixed permanently. No command reverses it.

Locking the EPC bank

UHFG2 E, L, "12345678"

After this, the EPC bank accepts no further writes. Appropriate when:

  • The EPC is finalised before shipping and must not be altered
  • Anti-counterfeiting requires the identifier to be immutable

Unlock:

UHFG2 E, U, "12345678"

The password must match the one used to lock, or the unlock fails.

Locking the USER bank

UHFG2 U, L, "12345678"

USER memory typically holds business data — batch numbers, inspection records, maintenance history. If any of that needs updating later, do not lock it.

Only lock USER memory when the contents are write-once constants, such as a factory serial or a build date.

Changing the access password

UHFG2 A, S, "87654321"

Bank A is special: alongside U/L/O/P it accepts S (set password) to change the password.

Record the original password before changing it. Lose it and the tag is frozen in its current state — readable but unwritable, and unlockable. Across a batch, that means scrapping the batch.

Best practice: use one password across all tags and store it in your production system configuration. Don't rely on anyone remembering it.

How the password banks are laid out

Access and kill passwords are both 32-bit (8 hex characters), stored in the Reserved bank:

BlockContents
Blocks 0–1Kill Password
Blocks 2–3Access Password

The kill password permanently disables a tag — after a kill operation it stops responding entirely. That's a retail loss-prevention feature; industrial users rarely touch it.

Industrial deployments should only use the access password. Kill is irreversible, and one mistaken operation destroys the tag.

When to lock, and when not to

This is where the expensive mistakes happen.

Reasonable to lock:

  • Before final delivery to a customer, once the EPC is settled
  • Anti-counterfeit and traceability where the EPC must map immutably to a product
  • Leased assets, to stop the lessee rewriting tag data

Better not to lock:

  • Work in progress. EPC or USER data may need rewriting between operations
  • Assets that circulate — totes, pallets, containers — where data updates on each movement
  • Any tag in testing
  • Any case where the business process might change

The principle: locking is one-way. Lock late rather than early.

In a production flow, locking belongs at the last operation, and it should require explicit confirmation — ideally not fully automated.

A realistic production example

Encoding and locking a product label at final pack:

SIZE 60 mm, 40 mm
GAP 2 mm
SET RF 8, , , 3, P, , 3
CLS
TEXT 10,10,"TSS24.BF2",0,1,1,"Product label"
UHFR H, 2, 12, E
UHFW H, 2, 12, E, "E28011606000020512345678"
UHFG2 E, L, "12345678"
PRINT 1

Sequence matters: write the EPC, lock it, then print.

Print first and a failed lock leaves you with a printed label that's already wasted. With e set to P in SET RF, any failing step pauses the printer for an operator to intervene.

Frequently asked questions

Can a locked tag still be read?

Yes. Locking only blocks writes; reads are unaffected.

Any standard UHF reader can read a locked tag's contents. If the goal is "nobody else can see this", locking won't achieve it — you'd need encrypted EPC data or simply not storing sensitive information on the tag.

What happens if the password is wrong?

The unlock fails and the tag stays locked.

Does repeated wrong entries brick the tag? ISO18000-6C has no lockout-on-failure mechanism. A wrong password simply fails that attempt; you can try again. But a genuinely forgotten password means the tag is unrecoverable.

Is there any way back from a permanent lock (P)?

No. Once UHFG2 X, P executes, that bank's lock state is fixed for the life of the chip.

This is precisely why production environments should use L rather than P — L at least leaves a password-protected exit.

The lock operation fails but the tag still reads and writes fine

Lock failures usually mean a wrong password, or a tag that doesn't support locking that bank.

Some low-cost tags only support EPC bank locking and return an error for USER bank locks. Confirm locking capability when specifying tags.

Can ISO15693 tags be locked too?

Yes, but through an entirely different mechanism — the L parameter on HFW:

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

ISO15693 locking is permanent. There is no unlock command. After execution the tag is read-only for good.

That's different from UHF L, which is reversible. Confirm the tag type before running it.

Need a hand?

Tell us the application and we'll help you decide whether to lock, and which bank.

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