A few months ago, I needed to add file conversion to a web app — nothing fancy, just letting users drop in a file and get back a different format. My first instinct was "call an API, done." But sending user files to a server means storage costs, privacy headaches, and a queue if traffic spikes. So I looked into doing it entirely client-side with WebAssembly. Here's what I learned, including parts that don't appear in the getting-started tutorials.
Why WASM for this at all
Most format conversion logic (codecs, container parsing, compression) is written in C/C++ or Rust, and that ecosystem is mature. Compiling it to WASM means you get near-native decode/encode speed running inside the browser tab with zero server round-trip. For many formats, this is genuinely fast enough for real-time use.
The most common building block here is a WASM build of FFmpeg (ffmpeg.wasm is the popular one). It gives you the same codecs FFmpeg supports natively, just running in a Web Worker.
Where it gets messy






