Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I built 272 privacy-first tools with WebAssembly and no backend

Five weeks ago I started building a PDF compressor. Today the site has 272 tools and none of them upload your files to a server. This is what the architecture looks like, why I made those choices, and where it breaks. The premise Every "free online PDF compressor" I could find has the same shape: you upload your file, their server compresses it, you download it back. Their privacy policy says…

Five weeks ago, the author began constructing a PDF compressor. Currently, the website boasts 272 tools, all of which operate without uploading files to a server. The architecture is explained below, the reasoning behind the choices made, and the limitations encountered.

The premise is that every free online PDF compressor shares a common structure: users upload their files, the server compresses them, and the results are downloaded back. Users must either trust that files are deleted within 24 hours or not trust anything at all. However, if files never leave the user's machine, trust is unnecessary.

In 2026, browsers have the capability to perform these tasks entirely on the client side using WebAssembly, Web Workers, the Canvas API, and a few mature JavaScript libraries. The author utilized this approach, creating 272 browser tools across PDF, image, video, audio, converters, calculators, writing, and developer utilities, all without requiring a sign-up, uploads, or ads.

The technology stack includes Next.js 16 for static export of tool pages, with each tool being an HTML file plus a JS bundle that lazily loads the required WebAssembly libraries. Specific libraries include ffmpeg.wasm for video and audio work, pdf-lib for PDF construction, pdf.js for PDF rendering, libheif-js for HEIC decoding (with Safari having native support and other browsers lacking it), the Canvas API and OffscreenCanvas for image resizing, conversion, cropping, and filtering, Web Workers for handling heavy operations off the main thread, and a service worker to cache wasm binaries after the first load, ensuring instant performance for subsequent visits to any video tools.

The examples provided include converting HEIC images to JPG using ffmpeg.wasm and merging multiple PDFs using pdf-lib. The conversion process involves importing the necessary functions, creating an instance of FFmpeg, loading the required wasm and core files, writing the input HEIC file, executing the conversion command with specified quality, retrieving the output data, and cleaning up the virtual file system to prevent memory leaks.

For merging PDFs, the author demonstrates importing the PDFDocument module from pdf-lib, creating a new document, iterating over the input files, loading each PDF file's array buffer, and appending them to the merged document.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What it takes to remove the monitor and keyboard: decoders, projection and phosphenes

The question that started this: can AI send signals into a brain so that an image shows up on someone's retina? I wanted to see AI output with my own eyes and skip the keyboard.

  • Decoding speech from brain activity involves motor areas and 256 intracortical electrodes.
  • Phosphene generation maps electrodes to phosphene production for per-patient tuning.
  • Retinal projection uses optics to maintain image sharpness regardless of eye focus.

More from Tuesday 29 September →