AI in the browser: how WebAssembly made on-device scanning possible
· How it works
Five years ago, “AI feature” implied a cloud API — your data visits their GPU. The quiet revolution: browsers learned to run serious compute locally, and small specialised models got good. Scanning is the poster child.
WebAssembly in one paragraph
WebAssembly (WASM) is a compact binary format browsers execute at near-native speed inside the same sandbox as any web page. Code written in C++/Rust — like computer-vision libraries and neural-network runtimes — compiles to WASM and runs in your tab, isolated from your files and other sites. It's how a web page can do work that used to need an installed app or a server.
Small models beat big ones (for this job)
Document tasks don't need giant general models: finding four corners, classifying 0/90/180/270 orientation, reading a line of OCR-B — each is a narrow task where a model of a few to a few dozen megabytes performs excellently. ToPDF ships exactly that set; together with the vision library they're a one-time ~55 MB download, cached like any asset, running in seconds even on mid-range phones.
Privacy as an architecture, not a promise
When the model is on the device, sending data anywhere becomes extra work someone would have to add — the opposite of cloud designs where local privacy is the extra work. That inversion is testable from outside: offline scanning works, network tabs stay quiet. (Verify it yourself.)
Frequently asked questions
Is browser AI slower than an app’s?
WASM runs close to native speed; for these small models the difference is fractions of a second. Big-model workloads (LLMs, photo generation) are a different story — document scanning simply isn’t one.
Does it drain my battery?
A page scan is a few seconds of CPU — comparable to applying a photo filter. There is no background processing before or after.
Scan it now — free & private
Snap a photo, get a clean auto-cropped PDF in seconds. Everything runs in your browser — your documents never leave your device.
Open the scanner