Skip to content
AgileLogics

Merge PDF

Combines two or more PDF files into a single PDF, one file after another in the order your browser lists the selected files, entirely in your browser.

How it works

Choose two or more PDF files (Ctrl/Cmd-click to select multiple) and click Convert.

How do you merge PDF files without uploading them?

You merge PDFs in the browser by reading each file locally and copying its pages into a new document. This tool does exactly that: pick two or more PDFs, click Convert, and it builds one combined file with pdf-lib, a JavaScript PDF library, without sending a byte of your documents to a server.

Most "free PDF merger" sites work the other way round: they upload your files, combine them on their machines and send back a download link. That's fine for a recipe, less fine for a tenancy agreement or a bank statement. Here the files are opened with the browser's FileReader API, merged in memory, and offered back to you as a download named merged.pdf.

Steps

  1. Click Choose PDF files and select every file you want combined. Hold Ctrl (Windows, Linux) or Cmd (macOS) to pick several at once, or Shift to pick a run of files.
  2. Click Convert.
  3. Click Download to save merged.pdf.
  4. Open the result and check the page order before you send it anywhere.

If you select only one file you'll see "Choose at least two PDF files to merge." The output box shows the new file encoded as a long data: URL; you can ignore it and use the Download link.

What the merged file contains

Under the hood the tool creates an empty PDF, then for each source file calls pdf-lib's copyPages for every page index and appends the copies. A page in a PDF is a self-contained object that points at its own fonts, images and drawing instructions, so copying a page brings all of that along. Anything that lives at the document level, outside the pages, is left behind.

Part of the source PDF Kept in the merged file?
Page content: text, vector graphics, images, embedded fonts Yes, unchanged
Page size and existing page rotation Yes
Annotations attached to pages (comments, link boxes) Copied with the page
Bookmarks / outline panel No
Document title, author and other metadata No; the new file gets pdf-lib's producer stamp and today's date
Fillable form fields May no longer work as fields
Password or permission protection Not applicable: protected files are rejected

Text stays selectable and searchable, because nothing is rasterised. The pages are copied as PDF objects, not re-drawn as pictures.

File order

The merge follows the order of the file list the browser gives the page, and there's no drag-to-reorder. That order comes from your operating system's file dialog, and it may not match the order you clicked in. If sequence matters (an invoice followed by its receipts, say), check the output. With many files, merging in smaller batches and checking each result makes a misplaced document easier to spot than scrolling through one 80-page file.

When merging fails

Errors from the PDF library are shown after the text "Could not merge those PDFs:", so you'll see the underlying reason.

Message ends with Cause What to do
"is encrypted. You can use ... ignoreEncryption" One file has password or permission protection Remove the protection in the original app, then retry
"No PDF header found" A file isn't really a PDF (renamed, truncated, or an HTML error page saved as .pdf) Re-download or re-export the file
Other parse errors The file is damaged or uses structure pdf-lib can't read Open it in a PDF viewer and "Save as" or "Print to PDF" a fresh copy

The encryption rule catches people out. The PDF format allows a file to open freely yet carry an owner password that restricts printing or copying (ISO 32000-1, section 7.6). pdf-lib treats any file with an encryption dictionary as off-limits by default, so even those "open but restricted" PDFs are refused.

Size of the merged file

The result is roughly the sum of the inputs, sometimes a little smaller. pdf-lib writes the new file with compressed object streams, which packs the small structural objects tightly, but it doesn't re-encode images, so ten scanned pages stay ten scanned pages' worth of data. If the combined file is too big to email, compress any photos before they go into a PDF using the image compressor, or run the merged file through the PDF compressor, which re-encodes embedded JPEG photos at a lower quality.

Related PDF tools

  • Split a PDF to pull a page range back out, for example to drop a cover page before merging.
  • Add page numbers to a PDF after merging, so the combined document is numbered continuously.
  • Convert JPG to PDF first if some of what you're combining is photos or scans saved as images.

Last updated

Frequently asked questions

Are my PDFs uploaded to a server when I merge them?
No. The files are read by your browser with the FileReader API and combined by the pdf-lib JavaScript library on your own device. The page makes no network request with the file contents, so this works for contracts, payslips and other documents you shouldn't hand to a third party.
Is there a limit on how many PDFs or how large they can be?
The tool needs at least two files and sets no upper limit on count or size. The practical ceiling is your device's memory, because every file is held in memory as base64 text while it's merged. A few dozen ordinary documents is fine on a laptop; very large scanned files may be slow on a phone.
Can I change the order of the files?
There's no reorder control on the page. Files are merged in the order the browser's file picker hands them to the page, so open the result and check the sequence before you send it.
Why do I get an error saying the document is encrypted?
pdf-lib refuses to open any PDF that has an encryption dictionary, which includes files that open without a password but restrict printing or editing. Remove the protection in the program that created the file (you'll need the password), then merge the unprotected copy.
Will bookmarks and form fields survive the merge?
Page content, images, fonts and links drawn on the pages are copied. Document-level bookmarks (the outline panel) are not, and fillable form fields may stop behaving as fields, because the merged file is a brand-new document that only receives the pages.