DEV Community

PDF Mergely
PDF Mergely

Posted on

How I built PDF tools that run entirely in your browser — no uploads, no servers

Most online PDF tools work the same way: you choose a file, it uploads to a server, the server does the work, and you download the result. For a flyer that's fine. For a contract, a payslip, or a bank statement, it means handing your document to someone else's computer and trusting what happens next.

I wanted to build a PDF toolkit where that question never comes up — so I moved the code to the file instead of the file to the code.

The core idea

A normal web app keeps its logic on a server, so your file has to travel to it. I flipped that around. Modern browsers can read the files you choose and run real processing locally — instead of sending your file to my code, I send my code to your browser. The PDF engine downloads once, then every operation runs on your device.

There's no upload step because there's nowhere to upload to. The part of a normal service that would receive your file simply doesn't exist.

How it actually works

  • The file stays in memory. The browser hands the app the bytes directly via the File API — they live in the tab, not on a server.
  • Web Workers do the heavy lifting on a background thread, so the UI stays responsive on large documents.
  • WebAssembly runs the fast parts — like AES encryption for password-protecting a PDF — at close to native speed.
  • A strict Content-Security-Policy locks the page down so file data has no network path out. Open the Network tab and watch: nothing leaves while you work.

The easiest proof for a skeptical user: after the first load, it works fully offline. You can merge PDFs on a plane.

The honest tradeoffs

This isn't magic. Because the work happens on your device, very large files depend on your machine's memory, and a phone won't be as quick as a desktop. I design around it — for example, processing one page at a time to keep memory in check.

What's there today

Merge, split, reorder, rotate, delete and extract pages, compress, watermark, page numbers, and password protect/unlock. All free, no sign-up, and it runs on mobile in any modern browser.

Try it: https://pdfmergely.com

I'd love feedback from other builders — especially on the client-side architecture, and on which tool to add next (OCR and edit/sign are the most requested so far).

Top comments (0)