Qraft StudioQR • BARCODE • NFC
Back to All Guides
NFC
8 min read2026-09-02

Web NFC API Guide: Writing NDEF Payloads, Tag Types & Browser Support

Learn how modern web applications can read and write NFC tags directly from mobile browsers using the W3C Web NFC specification, NDEF records, and smart tags.

D
Devon Chen
Hardware & IoT Engineer
Open NFC Studio

Interacting with Physical Objects Directly from the Browser

NFC (Near Field Communication) enables short-range wireless communication (~2–4 cm) operating at 13.56 MHz. With the standardization of the **Web NFC API**, web applications can now read and write lightweight NDEF (NFC Data Exchange Format) messages without requiring native Android or iOS app installations.

---

1. Browser Support & Permissions

  • **Supported Environments:** Android Chrome (v89+), Chromium-based mobile browsers (Edge, Opera, Brave for Android).
  • **Security Constraints:** The Web NFC API is strictly restricted to **top-level secure contexts (HTTPS)** and requires explicit user consent via permission prompts.

---

2. Anatomy of an NDEF Message

An NDEF message is a container composed of one or more **NDEF Records**. Each record specifies:

  • **TNF (Type Name Format):** Defines the record structure (e.g., Well-Known, MIME media-type, URI, Absolute URI).
  • **Record Type:**
  • * `"url"` or `"U"`: Standard website link with protocol prefix compression.
  • * `"text"` or `"T"`: Plain text memo with language code metadata (e.g., `en`).
  • * `"mime"`: Custom JSON, vCard, or binary payloads.

---

3. Writing to a Tag in JavaScript

async function writeSmartTag() {
  if (!("NDEFReader" in window)) {
    console.warn("Web NFC is not supported in this browser.");
    return;

const ndef = new window.NDEFReader(); await ndef.write({ records: [ { recordType: "url", data: "https://qraftstudio.toolpool.in" }, { recordType: "text", data: "Asset ID #9824 — Studio Inventory" } ] });

console.log("Tag written successfully!"); } ```

With our NFC Studio, you can construct multi-record NDEF payloads visually, inspect the exact byte breakdown, download raw binary `.ndef` files, and test live writing with one click.

Try it in the Studio

Generate Production-Ready Codes for Free

Create customizable vector exports with live mockups, error correction, and instant client-side rendering.

Open NFC Studio