Web NFC
Lets a site read and write NFC tags when the phone touches one.
In one line
Can scan NFC tags and save to them when your phone touches one
Lets a site read and write NFC tags when the phone touches one.
Reads tag messages (URLs, text, ids) and can write or lock them. A site can learn which tags the person tapped, for payments tags, tickets or inventory.
What it can and can't do
What the user does: You tap Scan or Save, allow NFC, then hold your phone near a tag.
It can
- Scan a tag your phone touches
- Save text or a link onto a tag
- Work only while the page is open and in front
It cannot
- Work in the background or when the page is hidden
- Work if NFC is turned off in your phone settings
- Work on iPhone, or in Firefox or Safari
- Use your phone's wallet or payment cards
How it differs between platforms: Only Chrome on Android supports it. iPhone does not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Not supported | Not available | Not listed | None |
| Edge | Not supported | Not available | Not listed | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 89 | 2021-03-02 | None |
| Samsung Internet | Supported | 15.0 | 2021-08-13 | None |
How a site asks for it
| API | new NDEFReader().scan(), reader.onreading, new NDEFWriter()/ndef.write(), makeReadOnly() |
| Permission name | nfc |
| Permissions policy | nfc |
| Browser compat keys | api.NDEFReaderapi.NDEFReader.makeReadOnlyapi.NDEFMessage |
| How access is granted | prompt |
| What the user sees | Permission prompt, plus a system NFC on setting; page must be in foreground |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Per origin |
| How to take it back | Site settings |
| Inside an iframe | Top level and same origin only; cross-origin iframes blocked |
Typical flow
- Click
- scan() prompts
- Bring tag near the phone
- onreading delivers serialNumber and NDEF records
Data you get
What comes back: NDEF records from tags
Shape: event
How often: per tap
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
serialNumber | string | None | tag UID, 4, 7 or 10 bytes | unique per tag |
records[].recordType | enum | None | text, url, mime, smart-poster, absolute-url, external, unknown | Not listed |
records[].data | binary | bytes | tag capacity (NTAG213 144 B, NTAG215 504 B, NTAG216 888 B) | Not listed |
Technical limits
- Only NDEF formatted tags, no card emulation or raw ISO-DEP
- Only while page is visible and focused
- Android only: no desktop, no iOS, no Safari, no Firefox
- Cannot read payment cards
The story
What it is
A site can read or write NFC tags when your phone touches one.
For you
You tap your phone on a tag, and the web page shows what is on it. It only works while the page is open on screen.
For makers
Makers get tag based tools with no app: tickets, inventory and smart posters. It is Chrome for Android only.
Where you see it
| Type | Example | Apps |
|---|---|---|
| live | An event site checks in guests by tapping an NFC wristband. | None named |
| shopping | A tag on a product opens a page with sizes and reviews. | None named |
| travel | A hotel room tag opens the check in page. | None named |
| games | A treasure hunt site reads tags around a museum. | None named |
| enterprise | A repair crew taps a tag on a machine to load its service log. | None named |
| security | A fake tag could point you to a bad site. | None named |
Risks
- Tag tracking
- Fake tags
What the platform says
- Google: Web NFC. Chrome's docs say Web NFC lets pages read and write NFC tags, on Android.
Good uses and abuse
Legitimate uses
- Tap to check in
- Product pairing
- Inventory tags
Known abuse
- Writing hostile tags that launch URLs
- Tracking tags by UID
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2020, Chrome on Android 100: makeReadOnly() added
- 2020-07, Chrome on Android 89: Web NFC ships on Chrome Android 89
Related capabilities
Related
- Web Bluetooth (GATT). Can connect to one nearby Bluetooth device you pick from a list
Sources
How well checked: Checked against real behavior.