Guide · Introductory · 7 min read
What can AI do inside a web browser?
AI models can run in a browser tab on your own CPU or GPU with nothing to install. What fits, what does not, whether you need a GPU, which browsers support WebGPU (checked 2026-11-28), and what "on-device" does and does not mean for privacy.
anastig editorial teamPublished
Yes. A web page can run an AI model on your own computer or phone, with nothing to install: the page downloads the model once, and your browser runs it on the processor (CPU) or, where supported, the graphics chip (GPU). You do not need a GPU for small models that find, outline or sort things in a photo: they can run on the CPU. In one desktop test, a small outlining model was ready in about 5 seconds; older laptops and phones are slower. A GPU starts to matter for large models, long videos and anything you want to feel instant, and the biggest models do not fit in a browser at all.
What happens when a page runs AI
Three things happen, and only the first one needs the network:
- The model downloads. A model is a file of learned numbers, called weights. The page fetches it, often with a small program that runs it, called a runtime. The browser can keep both for the next visit.
- Your device computes. On the CPU, the runtime uses WebAssembly, a compact code format that "brings near-native performance to the web" [1]. On the GPU, it uses WebGPU, a browser interface with "first-class support for GPGPU computations", meaning general calculations on the graphics chip, not only drawing [2][3].
- The result appears on the page: a box, an outline, a label or a piece of text.
Common runtimes are ONNX Runtime Web, which offers WebAssembly for the CPU and WebGPU, WebGL or WebNN for the GPU [4]; Transformers.js, which runs on ONNX Runtime and uses the CPU by default unless the page asks for WebGPU [5]; and Google's MediaPipe, whose web version runs on WebAssembly and can switch to the GPU [6]. ONNX Runtime notes that every operation works on the CPU path but "only a subset" on the GPU paths [4]. A page that cannot run a model on your GPU usually falls back to the CPU, more slowly.
Which browsers have WebGPU (checked 2026-11-28)
WebAssembly works in every current major browser. WebGPU does not yet, so MDN still lists it as not Baseline [2]. MDN's compatibility data, version 8.1.11, read on 2026-11-28 [7]:
| Browser | WebGPU |
|---|---|
| Chrome and Edge, desktop | Since version 113 on Windows, macOS and ChromeOS; Linux since 144, with Intel Gen12 or newer graphics only |
| Chrome on Android | Since version 121, on Android 12 or later with Qualcomm or ARM graphics [8] |
| Safari on Mac, iPhone and iPad | Since Safari 26 |
| Firefox, desktop | Windows since version 141; Apple-silicon Macs since 145–147; not on Linux or Intel Macs |
| Firefox on Android | Not supported |
Even in a supported browser, a page can only use WebGPU over HTTPS [2], and an older graphics driver or chip can still be refused. Without it, the same page normally runs on the CPU.
What fits in a browser, and what does not
The size of the download decides most of it. A model with 10 million weights stored as 32-bit numbers is a 40 MB file; stored in 8 bits it is 10 MB. Converting weights to fewer bits is called quantization, and browser runtimes rely on it: Transformers.js recommends quantized models in browsers "to lower bandwidth and optimize performance", and uses 8-bit weights by default on the CPU [5].
That gives a practical split:
- Fits well: detecting everyday objects, turning a box you draw into an outline (segmentation), and sorting photos into a handful of classes, with models built small enough for phones and browsers. Their downloads are measured in megabytes, not gigabytes.
- Fits with patience: chat-style language models of about a billion parameters. At 4 bits that is still 500 MB, about 7 minutes on a 10 Mbit/s line. Engines such as WebLLM use WebGPU for the heavy lifting and report keeping "up to 80% native performance on the same device" [9], so the device matters as much as the browser.
- Does not fit: the largest models. On the CPU path, 32-bit WebAssembly can address at most 4 GiB of memory, "the largest amount of memory possible with 32-bit pointers" [10]. An 8-billion-parameter model at 4 bits is 4.0 GB of weights alone, before any working memory. A 64-bit memory mode lifts that ceiling; MDN's data lists it from Chrome 133 and Firefox 134, and for a Safari version not yet released on 2026-11-28 [11].
- Not a browser job: training a model at scale, and long high-resolution video. At 2 seconds per frame, one minute of 30 frames-per-second video takes an hour.
Do you need a GPU?
For the jobs in the first bullet above, no. In one desktop test of a small on-device segmentation model without GPU acceleration (described in the next section), the CPU produced an outline in about 2 seconds. Google lists similar orders of magnitude for a small object detector in a native phone app: 61 ms per image on a Pixel 6's CPU and 28 ms on its GPU [12]. The GPU halves the time, but neither is slow. The Segment Anything paper describes a split that makes this practical: a heavy part reads the image once, and a light part turns each click or box into a mask in about 50 ms on a CPU in a browser [13].
A GPU helps when the model is large, when you process many images or video frames, or when you want results while you move the mouse. Chrome's documentation claims "more than three times improvements in machine learning model inferences" with WebGPU, from capabilities the older WebGL interface lacks [8]. That is the browser vendor's own figure, and the gain depends on the model and the chip.
What stays on your device
Two things stay behind after the page runs a model:
- The model files. Browsers keep site data until you clear it or space runs short; a single site may use a large share of the disk, up to 60 % in Chromium-based browsers [14]. Clear the site's data in the browser settings if you want the space back.
- Whatever the page chooses to store, such as labels, settings or images. A trustworthy tool says what it keeps.
What "runs on this device" means for privacy
On-device processing means the computation happens on your hardware, so the image does not need to travel for that step. ONNX Runtime's documentation puts the benefit simply: the data "never leaves the device for inferencing" [4]. It does not mean the page is offline or that nothing is sent. The page's own code decides what it sends, and analytics, error reports and extensions can still see the page. The model download itself also tells the site that you used the feature.
So treat "runs in your browser" as a claim you can check. Open the browser's developer tools, watch the network log while you add an image and run the model, and look at every request with a body that appears after you add the image, not only file-sized ones: a page can upload a smaller copy, a crop or numbers extracted from the image. Do my images leave my device? walks through that ten-minute check, and how to verify local AI image processing goes further.
Try it without an account
Anastig's demo and Vision Lab run models in your browser without an account. The measured example above comes from the demo: on 2026-11-28, on a desktop computer without GPU acceleration, its smallest on-device segmentation model downloaded and was ready in about 5 seconds and produced an outline in about 2 seconds, on the CPU in the browser. It was a single run on a fast machine and connection, not a benchmark. Vision Lab runs an object detector and a box-to-outline segmentation model and shows next to each result where it ran and how long it took. As checked on 2026-11-28, signed out, in one desktop Chromium browser: no request carried the image or any part of it, during the run or when leaving the page; the model files and runtime came from Anastig's own website; and only the CPU (WebAssembly) path was observed.
To read a detector's boxes and scores step by step, see run object detection on an image in your browser.
When a local worker or the cloud is the better choice
Move the work out of the browser when:
- The model is too big, or the feature you need runs only on a server or worker.
- You have many images or long videos. A program on your own GPU machine, called a local worker, is faster. Using your own GPU for browser AI covers how to set one up safely, and WebGPU vs CPU vs a local GPU worker compares the options.
- You need to train. See how much GPU memory a vision model needs and whether you can train a model on your own computer.
- Your device is old or slow. A trusted server, with an agreement covering your data, may serve you better.
If the browser keeps falling back to the CPU when you expect the GPU, why browser AI sometimes falls back to CPU explains the usual causes.
References
- [1] MDN Web Docs. WebAssembly. Accessed 2026-11-28. developer.mozilla.org/en-US/docs/WebAssembly
- [2] MDN Web Docs. WebGPU API (last modified 2 September 2026): limited availability, secure contexts only, GPGPU support. Accessed 2026-11-28. developer.mozilla.org/en-US/docs/Web/API/WebGPU_API
- [3] W3C. WebGPU (Candidate Recommendation Draft). Accessed 2026-11-28. www.w3.org/TR/webgpu/
- [4] ONNX Runtime. Web: run models in the browser (execution providers wasm, webgpu, webgl, webnn; operator coverage; benefits of in-browser inference). Accessed 2026-11-28. onnxruntime.ai/docs/tutorials/web/
- [5] Hugging Face. Transformers.js documentation: runs on ONNX Runtime; CPU (WASM) by default, WebGPU on request; dtype options fp32, fp16, q8 (default for WASM) and q4. Accessed 2026-11-28. huggingface.co/docs/transformers.js/index
- [6] Google AI Edge. MediaPipe: setup guide for web (WebAssembly runtime, CPU or GPU delegate, model asset loading). Accessed 2026-11-28. developers.google.com/edge/mediapipe/solutions/setup_web
- [7] MDN browser-compat-data 8.1.11 (data timestamp 2026-11-28), entry api.GPU: browser support for WebGPU, with platform notes. Accessed 2026-11-28. bcd.developer.mozilla.org/bcd/api/v0/current/api.GPU.json
- [8] F. Beaufort. Overview of WebGPU. Chrome for Developers, last updated 11 August 2025. Accessed 2026-11-28. developer.chrome.com/docs/web-platform/webgpu/overview
- [9] C. F. Ruan, Y. Qin, A. R. Parthasarathy et al. WebLLM: A High-Performance In-Browser LLM Inference Engine. arXiv:2412.15803, 2024 (revised April 2026). arxiv.org/abs/2412.15803
- [10] V8 team. Up to 4GB of memory in WebAssembly. v8.dev blog, 14 May 2020. v8.dev/blog/4gb-wasm-memory
- [11] MDN browser-compat-data 8.1.11, entry webassembly.memory64: 64-bit WebAssembly memory in Chrome 133, Firefox 134 and Safari 27.3 (listed without a release date). Accessed 2026-11-28. bcd.developer.mozilla.org/bcd/api/v0/current/webassembly.memory64.json
- [12] Google AI Edge. MediaPipe object detection task guide: average latency on Pixel 6, EfficientDet-Lite0 float32, 61.30 ms on CPU and 27.83 ms on GPU (native app). Accessed 2026-11-28. developers.google.com/edge/mediapipe/solutions/vision/object_detector
- [13] A. Kirillov, E. Mintun, N. Ravi et al. Segment Anything. ICCV 2023 (arXiv:2304.02643): prompt encoder and mask decoder run in a web browser, on CPU, in about 50 ms given a precomputed image embedding. arxiv.org/abs/2304.02643
- [14] MDN Web Docs. Storage quotas and eviction criteria. Accessed 2026-11-28. developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria