Why conversion belongs in the browser
Uploading a file to convert it means handing a copy of that file to somebody else's disk. For payslips, medical scans, contracts and identity documents that is an unacceptable default. Local conversion removes the transfer entirely: the bytes never leave the tab.
The secondary benefit is latency. A 40 MB video no longer needs a round trip; the only cost is CPU time on a machine the user already owns.
What WebAssembly changes
WebAssembly is a portable binary instruction format that runs at near-native speed inside the browser sandbox. Mature C and C++ codebases — FFmpeg, libvips, Ghostscript, Tesseract — compile to WASM largely unchanged, which means decades of battle-tested media code is available client-side.
Crucially, WASM inherits the browser's security model. A malformed file that would trigger a buffer overflow on a server is contained inside a linear memory sandbox with no filesystem or network access.
The practical toolchain
Images: the Canvas and OffscreenCanvas APIs handle raster conversion, resizing and compression natively; heic2any covers Apple's HEIC container.
Documents: pdf-lib for merge, split, rotate and encrypt; pdf.js for rasterising pages; mammoth for DOCX to HTML; SheetJS for spreadsheet formats.
Media: ffmpeg.wasm for audio and video transcoding. Text recognition: tesseract.js for OCR in 100+ languages.
Keeping the UI responsive
Run every conversion inside a Web Worker. A synchronous FFmpeg call on the main thread freezes the tab, and users interpret a frozen tab as a crash.
Stream progress back with postMessage so the progress bar reflects real work rather than a fake animation. Use transferable objects for ArrayBuffers to avoid copying large payloads between threads.
Honest limitations
Memory is the hard ceiling. A 32-bit WASM module addresses at most 4 GB, and mobile Safari often caps far lower. Very large videos and 500-page scanned PDFs remain server territory.
Codec licensing also applies: H.264 and HEVC encoding may require licensed builds, whereas VP9, AV1 and Opus are royalty-free and safe to ship.

