How to enable WebNN in Edge and Chrome

WebNN Edge Chrome NPU browser-ai

How to enable WebNN in Edge and Chrome

WebNN lets a web page use the machine-learning acceleration provided by the operating system, including an NPU or GPU. It is still experimental or in preview on some browser and platform combinations. Browser version, operating system, drivers, and hardware all affect availability.

A website cannot turn on a browser experiment for you. If a tool reports that WebNN is unavailable, or that the API exists without an NPU/GPU context, follow the steps below.

Fastest setup on Windows

Use the latest Microsoft Edge Beta for GPU testing. Use the latest Edge Canary when you specifically need to test an NPU.

  1. Update Windows 11 and install the latest NPU/GPU driver from your device or graphics vendor.
  2. Open edge://flags in the address bar.
  3. Search for WebNN API.
  4. Set the matching option to Enabled.
  5. Select Restart, or close every Edge window and reopen the browser.
  6. Return to this site, refresh the page, and check the WebNN status again.

If the WebNN API option is missing, that browser build or platform does not expose the experiment. Update the browser first, then try Edge Beta or Edge Canary.

Enable WebNN in Chrome

  1. Update to the latest Chrome or Chrome Canary.
  2. Open chrome://flags.
  3. Search for WebNN API.
  4. Set the matching option to Enabled.
  5. Fully restart Chrome, then refresh the tool page.

Chromium builds may rename, hide, or enable the option by default. Do not depend on a fixed internal flag ID; use the WebNN API option visible in your browser build.

If the NPU is still unavailable

Enabling WebNN does not guarantee that an NPU context can be created. You also need supported NPU hardware, its driver, and a compatible browser backend.

Microsoft's preview documentation also lists this NPU launch argument:

msedge.exe --disable_webnn_for_npu=0

Try it only when the latest Edge Canary has WebNN enabled but still cannot expose the NPU. This is a preview setting and may be removed or renamed. GPU acceleration normally does not need it.

Use a secure page

WebNN is a powerful feature restricted to secure contexts. Production pages must use HTTPS. Local development should use localhost or 127.0.0.1.

navigator.ml may be missing when:

  • A local-network page uses plain HTTP.
  • The page runs in a third-party iframe without WebNN permission.
  • An enterprise policy disables experimental features.
  • The browser, operating system, or driver does not support WebNN.

Test WebNN in the console

Press F12, open Console, and run:

async function checkWebNN() {
  if (!('ml' in navigator)) {
    return { enabled: false, reason: 'navigator.ml is missing' };
  }

  for (const deviceType of ['npu', 'gpu', 'cpu']) {
    try {
      const context = await navigator.ml.createContext({ deviceType });
      context?.destroy?.();
      return { enabled: true, deviceType };
    } catch {
      // Try the next backend.
    }
  }

  return { enabled: false, reason: 'The API exists, but no context could be created' };
}

checkWebNN().then(console.log);

You can also open the WebNN NPU Benchmark to see which backends your browser exposes.

Troubleshooting results

ResultLikely causeFix
navigator.ml is missingWebNN is not exposed, the flag is disabled, or the page is not secureUpdate the browser, enable WebNN, and use HTTPS
API exists, but no context can be createdUnsupported driver, hardware, or browser backendUpdate the OS and drivers; try Edge Beta/Canary
GPU works, NPU does notNo supported NPU, or the NPU backend is still in previewKeep using the GPU; WebNN is already enabled
The tool still reports WASMThe page loaded before restart, or WebNN initialization failedFully restart the browser and hard-refresh the page
No flag on mobile, macOS, or LinuxPlatform support differsCheck the latest Chromium build; keep the WASM fallback if absent

Can a tool still fall back to WASM?

Yes. A model may use operators that the current WebNN backend does not support, or context creation may fail. Tools on this site try WebNN first and fall back to WebGPU or WASM so the feature still works.

A status saying that the WebNN GPU is available means WebNN is enabled successfully. Continue troubleshooting only if you specifically need low-power NPU inference.

Official references