Merge PDF files without uploading them

Merge two PDF files into one PDF — or twenty, if you have them — and you get a single file smaller than the parts. The files are read on your own machine, the pages are joined, the pictures inside the merged document are re-encoded, and you take one file away. Measured on three printed documents: 908,204 bytes from 2,001,057.

How do I merge PDF files when there is a file size limit on the form I am filling in, or when an email will not take the attachments I already have? A PDF merger that uploads your files is asking you to trust it with the documents you least want to send anywhere; this one never does. Add them in the order you want the pages to run, drag them up or down, and the combined document is written on your device — so the words stay selectable, the links on each page stay, and nothing is copied to a server in between.

  • Nothing is uploaded
  • Text stays selectable
  • Page order is yours
  • Unlimited & free

Drop your PDFs here

two or more files, and the pages follow the order you drop them in

PDF — as many as you like, no size limit, nothing leaves your device

Settings

Applied when you run it
lower is smaller; 60 is the measured default
60

What we measured, and what it means

Three documents were printed to PDF by the same browser: four pages of photos, one page with a photo and body text around it, and one page of text only. They were merged here, and then the pictures of the merged file were re-encoded — the same way you would merge the PDF by hand, only without the upload and without a bigger file coming back.

  • Three files, 2,001,057 bytes together → merged, 2,001,198 bytes. A lossless merge costs almost nothing: 141 bytes for a new page tree, a catalog and the page size it inherits.
  • Merged, then re-encoded: 908,204 bytes. That is 1,092,853 bytes smaller than the three parts, or 54.6% smaller — and the merged file was 2,001,198 bytes, so the re-encoding is where all of it comes from.
  • Five pictures replaced, none skipped. Four of them 2400×1600 and one 1600×1000, each decoded and re-encoded once by this site's own encoder.
  • Seven pages, and all seven readable afterwards. The text of every page came back, which is what the rebuilt table of offsets is for.
  • A document with no pictures does not shrink. The text-only file was 11,381 bytes and contributed no image streams, so there was nothing to take bytes from — that part of the saving simply is not there.

The fixtures are generated by the browser's own print-to-PDF from a seeded random source, so the same seed brings the same three documents back. Two re-runs against them have come out at 908,204 bytes and at 908,211 bytes — a few dozen apart, which is the re-encoder and not the maths. The method, the per-image figures and the scripts are kept with the rest of this project's measurements, and the merged files are written out so a second parser can read them independently.

How it works

Whether you want to merge PDF files, combine PDF files into one document, or join PDF files you printed separately, the job is the same: the pages of each file have to end up in one page tree, and every reference inside your files has to keep pointing at the right object afterwards.

  1. Every file is walked and its objects are copied into one numbering space. Two files both call their first page 5 0 obj, so one of them has to move; each file is given a range of numbers no other file uses, and the references in its dictionaries are shifted to match.
  2. Only the dictionary text is rewritten. The raw bytes of each image stream are copied exactly as they came, because a JPEG can legitimately contain the sequence " 0 R" and rewriting it would corrupt a picture without producing any error.
  3. The pages are joined into a single PDF and the file is closed properly. One /Pages node holds every page as /Kids, each page's /Parent points at it, and the table of offsets at the end of the file is rebuilt from the offsets actually written.
  4. Then, if you asked for it, the pictures are re-encoded. Decoded on a canvas, re-encoded at the quality you chose, and swapped back in — which is the step that takes the merged file from 2,001,198 bytes to 908,204.

Encrypted files are refused rather than guessed at. Files that pack many objects into one compressed stream are opened when the browser can inflate them, and reported with a count when it cannot. Anything the tool could not read is counted in the result instead of quietly dropped.

If you only need the smaller half of this — one document, no merging — the PDF shrinker does just that, and it works on a single file. To turn the other way round, photos into a PDF, there is images to PDF.

Frequently asked questions

Does merging PDFs actually make the file bigger than the parts I had?

Very slightly, and then much smaller if you let the tool re-encode the pictures. On three seeded documents we measured — four photo pages, one photo page with body text, and one page of text only — the parts came to 2,001,057 bytes together, the lossless merge came to 2,001,198 bytes, and that is the new page tree and the catalog being written: 141 bytes for seven pages, which is nothing. Re-encoding the five pictures inside brought the same document down to 908,204 bytes, which is 54.6% smaller than the parts. So the answer to "the merged file is bigger than the originals" is yes for a moment, and no once the pictures are dealt with.

Is my document uploaded to a server when I merge it here?

No. The files are read with the browser's own file reader and the merge happens in the page. There is no endpoint on this site that accepts a PDF, which is why there is no upload bar, no progress percentage and no queue to wait in. If you want to check the claim rather than take it, the same site publishes a measured upload test for image tools and invites re-running it.

Will the text still be selectable, and will the pages come out in the order I added them?

Both, and in the order you put them in. The merge copies the objects of each document into one numbering space and joins their pages into a single page tree, so the words, the fonts and the links on each page are carried over exactly. Moving a document up or down in the list moves its pages in the result. What does not come across is the document-level bookmarks of the files you merged: those hang off the catalog of the first file, and a merged document has one catalog, not one per page range.

Why are the pictures re-encoded at all — isn't a merge supposed to be lossless?

A merge is lossless in the sense that it does not redraw anything: your pages become pages, not images of pages. That is still not the same as a small file, because the pictures inside a merged document are still the pictures from the parts, which is where the bytes sit. Every PDF tool we could find stops at the merge and leaves you with a file that is bigger than what you started with, to be emailed through an attachment limit. Re-encoding the pictures once, on the merged file, is what makes the result smaller than the parts.

What happens to an encrypted or password protected document?

It is refused, and the refusal is the useful behaviour. An encrypted file's stream lengths cannot be read in plain text, so there is no safe way to move its objects into another document — anything written would be a file that will not open. The page says which of your files could not be read and leaves the rest to be merged, rather than quietly producing a broken document.

Can I merge a PDF that has pictures packed inside compressed object streams?

Usually, and the tool reports it when it happens. A file from a heavyweight editor can pack dozens of small objects — resource dictionaries, content streams — into one compressed stream, and those objects do not appear as ordinary entries. When the browser can inflate a compressed stream, this page opens it and the objects inside take part in the merge like any other. When it cannot, the stream is copied as it came and the result says so with a count, so you are never left guessing at a page that went missing.

How many files can I merge at once?

Merging multiple PDF files at once is the everyday case here. There is no limit in the tool; the limit is your device's memory, since everything happens locally with no server to offload it to. Two documents is the usual shape of it, and five or six are comfortable on an ordinary laptop. What does bite is the size of the pictures inside them, because those are decoded on a canvas before they are re-encoded — a merge of a handful of scanned documents is a memory job, not a bandwidth one.