Two web standards decide how a page can run an AI model on the visitor's own device: WebGPU, which gives scripts access to the graphics processor for rendering and general computation, and WebNN (the Web Neural Network API), a dedicated interface for neural network inference. As of October 2026, both are Candidate Recommendation Drafts at the W3C, not finished Recommendations, so their details can still change.
Key takeaways
- WebGPU is a general GPU interface for rendering and computation, and it is the successor to WebGL.
- WebNN is a lower-level interface aimed only at neural network inference, and its specification names CPU, GPU, and NPU as target devices.
- Both specifications were Candidate Recommendation Drafts when checked on October 27, 2026 (WebNN dated October 21, 2026, WebGPU dated September 15, 2026).
- MDN lists WebGPU as not Baseline, so a page needs a fallback for browsers that lack it.
- Running a model on the device keeps the input there, but it does not remove all privacy questions.
Why web developers care where a model runs
A page that uses AI can send data to a server, or it can run the model in the browser. Server-side inference is simple to ship and keeps heavy computation off the visitor's device. Browser-side inference avoids a network round trip, can keep working offline once files are cached, and keeps the input on the device. The WebNN project's own landing page lists low latency, offline use, and lower server cost among its motivations, and says that on-device inference preserves user privacy. Those are goals stated by the standard's authors, not measured results, and the trade-off is that the visitor's hardware does the work. Standards matter here because, without them, each browser or library would need its own route to the processor.
WebGPU: a general interface to the graphics processor
The WebGPU specification opens with a one-line abstract: it exposes an API for performing operations, such as rendering and computation, on a graphics processing unit. A script requests an adapter and a device, builds a compute pipeline, records dispatch commands, and submits them through the device's queue. Mozilla's MDN documentation describes WebGPU as the successor to WebGL, which was designed around drawing to a canvas and handles general computation poorly. WebGPU shaders are written in WGSL instead of GLSL, and MDN cites machine learning as one example of computation that benefits.
The MDN page carries a "Limited availability" banner stating that the feature is not Baseline because it does not work in some of the most widely used browsers, and it is available only in secure contexts (HTTPS). Its own example code tests for navigator.gpu before doing anything else, which is the pattern a production page needs.
WebNN: a narrower interface for inference
The WebNN specification describes a dedicated low-level API for neural network inference hardware acceleration. It defines a hardware-agnostic abstraction layer so that a script can describe a computation graph and let the browser and operating system map it to whatever machine learning capability the device has. The specification states that graph execution supports CPU, GPU, and NPU devices, where an NPU is a neural processing unit, a chip block built for this kind of work. A device preference is a hint, and the browser makes the final choice.
The design reflects privacy and security concerns. The specification says input data stays on the user's device and that the API limits fingerprinting through standardization: the chosen device is not exposed and devices cannot be enumerated, and the results of one capability-query method are bucketed to reduce what they reveal. All interfaces are limited to secure contexts, the API is disabled by default in cross-origin frames unless the embedding page grants permission, and the document says that timing and side-channel risks need further mitigation, with some items still open.
The two interfaces side by side
The table summarizes what each specification says about itself. It is a reading aid, not a recommendation for either one.
| Question | WebGPU | WebNN |
|---|---|---|
| Main purpose | Rendering and general computation on a GPU | Neural network inference acceleration |
| Target hardware named in the specification | Graphics processing unit | CPU, GPU, and NPU |
| Status when checked | Candidate Recommendation Draft, September 15, 2026 | Candidate Recommendation Draft, October 21, 2026 |
| Secure context needed | Yes, per MDN | Yes, per the specification |
| Shader or graph language | WGSL shaders and compute pipelines | A graph of neural network operations |
What a Candidate Recommendation Draft means
The W3C describes a Candidate Recommendation Draft as a working version that folds in changes the group intends to include in a later Candidate Recommendation Snapshot. The WebNN document itself warns that it may be updated, replaced, or obsoleted at any time. The WebGPU page contains a statement that it will remain a Candidate Recommendation at least until February 28, 2025, which conflicts with its 2026 date, so readers should treat the date line as unreliable and rely on the status header. For web developers, the practical meaning is that code written against either interface should check for support at run time and keep a server or CPU fallback.
Questions to ask before building browser-side AI
- Does the target audience use browsers where the interface is available, and is there a fallback when it is not?
- How large is the model file, and who pays for its download?
- Does the feature need the input to stay on the device, or is server processing acceptable?
- Is the page served over HTTPS, and does an embedded frame need permission to use the API?
- Which hardware will run the work, and what happens on a device with no GPU or NPU?
FAQ
Is WebNN the same as WebGPU?
No. WebGPU is a general interface for rendering and computation on a GPU. WebNN is specific to neural network inference and can target CPUs, GPUs, and NPUs.
Are these standards finished?
No. Both were Candidate Recommendation Drafts on the W3C site when checked on October 27, 2026, which means the specifications can still change.
Does running a model in the browser make it private?
It keeps the input on the device, which the WebNN materials describe as a privacy benefit. The specification also lists fingerprinting and side-channel concerns, so privacy still depends on the whole page and its other scripts.
Will every browser support these APIs?
Not necessarily. MDN labels WebGPU as limited availability and recommends testing for navigator.gpu. Support for WebNN was not confirmed here, so a page should detect it before use.
Related reading
- AI and the future of software development
- AI development and adoption by country
- DeepSeek explained
- How fast AI development has grown
More in AI Tools and Industry.
Last verified: October 2026
Sources
- Web Neural Network API, W3C Candidate Recommendation Draft, October 21, 2026
- WebGPU, W3C Candidate Recommendation Draft, September 15, 2026
- WebGPU API, MDN Web Docs, Mozilla, 2026
- Web Neural Network API landing page, W3C Web Machine Learning Working Group, 2026