Back to guides

Why You Can't Erase a Card on Your Phone: Protected vs Locked NFC

If your phone won't erase an NFC card, it is either a protected card built to refuse writes or a tag that was locked read-only. Here is how to tell them apart.

Published

Why your phone can't erase that card

If your phone refuses to erase an NFC card, one of two things is going on. Either the card is protected, meaning it was built to refuse your phone, or the tag is locked, meaning someone set it to read-only. They look alike in the app. The fix is different, and neither is a bug in your phone.

Here's how each works, how to tell which you have, and what to do next.

Protected cards: built to refuse your phone

Access badges, transit cards and similar credentials are shielded on purpose. As one NFC app maker's troubleshooting page puts it, some NFC tags are protected against reads and writes, and for that kind of chip you can't read, write, copy or emulate it.

That is the whole point of the design. A building badge that any phone could rewrite would not be much of a badge.

You may also notice that a protected card scans, but your app shows no readable NDEF records. That's normal for many secure cards. We cover it in why some cards show no NDEF records.

If it's an access or transit card, the honest answer is no: you can't erase it with a phone, and you shouldn't try. Ask whoever issued it.

Locked tags: read-only on purpose

A locked tag is a different case. It is an ordinary tag, such as an NTAG sticker, that was switched to read-only after it was written. It still scans fine. It just won't take new data.

On Android, the Ndef class exposes this state. isWritable() tells you whether a tag is read-only or read-write, and canMakeReadOnly() tells you whether it can be locked. The key detail is in the docs for makeReadOnly(): it sets the capability container to read-only and, where possible, permanently sets the lock bits. The documentation states plainly that this "is a one-way process and cannot be reverted."

NXP's NTAG 21x chips show the hardware side of this. The product page lists a field-programmable read-only locking function per page, plus a capability container with one-time programmable access bits. Once those bits are set, there is nothing to switch back.

Password-protected tags

Locking isn't the only way a tag says no. The same NTAG 21x chips support 32-bit password protection, with an optional limit on failed attempts. A tag set up this way can refuse memory operations until the right password is supplied. If you know the password, you may be able to change it. If you don't, your phone can't guess it for you.

How to tell which one you have

Work through these checks in order:

  1. Scan it in a reader app and open the read view. A locked tag usually shows a read-only status. Our guide to checking whether a tag is read-only walks through it.
  2. Check the tag type. A bare sticker or keyfob tag you bought to write on is likely a locked NTAG. A card from an employer, hotel, gym or transit system is likely protected.
  3. If you write code on Android, call isWritable(). If Ndef.get(tag) returns null, the tag isn't NDEF formatted, or it uses a vendor format your phone doesn't implement. In that case an NDEF write won't work at all.

Other reasons a write fails

Not every failed write is a lock. The same troubleshooting page lists several ordinary causes:

  • The tag doesn't have enough memory for what you're writing.
  • You moved the tag during the operation.
  • A case, a metal surface or a nearby battery is interfering with the antenna.
  • The tag is damaged, or NFC is turned off.

Rule these out first. Our guide to a write error that is not a lock at all helps you separate the two.

What to do next

  • Protected card: leave it as it is. Contact the issuer if you need it changed or replaced.
  • Locked tag: if the lock was permanent, it stays read-only. Use a fresh tag for your project.
  • Password-protected tag: you need the password. Without it, treat the tag as locked.
  • Ordinary write failure: fix the cause (memory, placement, case, NFC setting) and try again.

Think twice before locking any tag you may want to reuse. If you want an app that shows tag status and writes to tags you own, NFCore is on the App Store and Google Play. Keep in mind that iPhone support for NFC is more limited than Android's, so some tag operations are only possible on Android.

Frequently Asked Questions

Can I unlock a locked NFC tag?

If the lock bits were set permanently, no. Android's documentation says making a tag read-only is a one-way process that cannot be reverted. A tag that is only password-protected can be changed if you know the password.

Why can my phone read my access card but not erase it?

Access cards are built to resist changes. Some are protected against both reads and writes, and many can't be copied or emulated by a phone at all.

How do I know if a tag is locked?

Scan it in a reader app and look at its status. In Android code, Ndef.isWritable() reports whether the tag is read-only or read-write.