Web NFC
Asks to read or write NFC tags with your phone.
In one line
Can scan NFC tags or save to them with your phone, after you allow it
Asks to read or write NFC tags with your phone.
Lets a page scan NDEF tags and write to them. Only while the page is visible and focused. Android Chrome only.
What it can and can't do
What the user does: You tap Scan tag or Save to tag, then hold your phone near it.
It can
- Scan an NFC tag when your phone touches it
- Save text or a link onto a tag after a tap
- Scan only while the page is open and in front
It cannot
- Work in the background or when you switch apps
- Save onto a tag without a tap on the page
- Use your phone's wallet or payment cards
- Work on iPhone, desktop or most browsers other than Chrome on Android
How it differs between platforms: Only Chrome on Android supports it. iPhone and other browsers do 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 | Not supported | Not available | Not listed | None |
How a site asks for it
| API | new NDEFReader(); reader.scan(); reader.write(); permission nfc |
| Permission name | nfc |
| Browser compat keys | api.NDEFReader |
| How access is granted | prompt |
| What the user sees | Chrome Android prompt: Scan NFC tags; needs a gesture to write. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Persistent per origin |
| How to take it back | Site settings |
| Inside an iframe | Top-level only (not delegated) |
Typical flow
- Click
- ndef.scan()
- Prompt
- Reading event delivers records
Data you get
What comes back: NDEF records (url, text, mime, smart poster)
Shape: event
How often: per tag scan
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
serialNumber | string | hex | tag UID, 4 to 10 bytes | high entropy |
records | array | NDEF | per tag | tag content |
Technical limits
- Android Chrome only
- Page must be visible
The story
What it is
A site asks to read or write NFC tags using your phone.
For you
You tap your phone to a tag or card and the page reads it. It only works while the page is open and on screen, and only on Chrome for Android.
For makers
Makers can build tag based tools without a native app: event check in, inventory, product info and smart posters.
Where you see it
| Type | Example | Apps |
|---|---|---|
| travel | You tap an NFC tag at a hotel to check in on the hotel's website. | None named |
| shopping | A tag on a shirt opens its product page with sizes. | None named |
| live | Event staff scan NFC tickets with a phone browser to let people in. | None named |
| games | A web based scavenger hunt reads tags hidden around a city. | None named |
| enterprise | A warehouse worker taps a tag on a shelf to update inventory. | None named |
| security | A cloned tag could be used to trick a page that trusts what it reads. | None named |
Risks
- Tag tracking
- Android only
What the platform says
- Google: Web NFC. Chrome's docs say Web NFC lets sites read and write NFC tags on Android.
Good uses and abuse
Legitimate uses
- Ticketing
- Inventory tags
Known abuse
- Tag tracking
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | 5 | Rough identifying entropy, when known |
History
- 2021-03, Chrome 89: Web NFC ships on Android
Related capabilities
Related
- Permissions API. Can check whether you allowed or blocked a feature, without asking you
Sources
How well checked: Based on official documentation.