Skip to content
PDFSamurai
All articles

How-to · 5 min read

How to merge PDF files (without uploading them anywhere)

A practical guide to combining PDFs in your browser — and why “upload-and-merge” services are quietly risky.

PDFSamurai Editorial

Merging PDFs sounds trivial — and on paper, it is. You pick two or three files, you put them in the right order, and you save the result as one document. In practice, most popular online tools do something you might not expect: they ship your files to a server you do not control, parse them there, and trust you not to mind.

The browser-based way

Modern browsers can read PDF byte streams directly. With the open-source library pdf-lib, the entire merge operation fits inside one JavaScript function. The file you select is opened in tab memory, the pages are copied across to a new in-memory document, and the result is offered to you as a download. No network hop is ever required.

On PDFSamurai’s merge tool the workflow is exactly that. Drag in your PDFs, drag them into the right order, press Merge. The progress bar you see is the time your processor takes to copy bytes between pages.

What “local processing” actually means

A common misconception is that any online tool is server-based by default. That stopped being true around 2018, when WebAssembly and the modern File API made it realistic to do non-trivial document work entirely client-side. The trade-off is bundle size: the PDF libraries are a few hundred kilobytes, which is comparable to a single mid-sized image and downloaded once.

What to look out for

  • Open the network tab in your browser dev tools while you use a “merge PDF” service. If you see a POST request whose body is your file, the service is uploading it — full stop.
  • Check whether the site loads the PDF library on the merge page itself, or whether it talks to an API endpoint that returns the merged file.
  • Read the privacy policy for the words retention, delete, and third-party processor. Vagueness is a signal.

When server processing actually makes sense

For workflows above ~500 MB, very old browsers, or for OCR over large scanned books, server processing is sometimes the better engineering choice. The point is not that uploads are evil — it is that you should know when one is happening.

A tool that processes locally also tends to be a tool that loads faster, fails less often, and works on planes.

We built PDFSamurai because every PDF tool we used in our day jobs made us think twice before dropping anything sensitive into them. The answer turned out to be simple: do not ask for the file in the first place.

Continue reading

More from the journal.