Why merge PDFs on your own device
Cloud converters are convenient, but they ask you to upload the document before you can see the result. For a utility bill that is acceptable; for an unsigned contract, a payroll export or a medical letter it is a data-protection decision, not a formatting one. Merging in the browser keeps the bytes on your machine. The page reads files through the File API, builds a new document in memory and hands you a download. There is no upload endpoint to audit, which also means the result is only as private as your own device, browser extensions and screen.
Local processing has a cost: the tab must hold every source file and the growing output. That is why a browser tool is excellent for a handful of documents and awkward for a gigabyte of archived scans. Knowing which side of that line your job falls on is more useful than any claim of unlimited capacity.
How a PDF page tree works
A PDF is a graph of objects, not a stack of pictures. The trailer points to a cross-reference table, the catalog points to a page tree, and each leaf of that tree is a page object. A page object names a content stream plus the resources it needs: fonts, colour spaces, image XObjects, sometimes form XObjects shared by several pages. Because resources are referenced rather than embedded per page, ten pages that use the same font store it once. This is also why naive concatenation of two PDF files does not work: object numbers collide, the xref offsets become wrong, and readers either repair the file or refuse it.
A merge therefore has to do real bookkeeping. It reads the xref table, resolves indirect references, copies the objects it needs and renumbers them in the destination file. A well-behaved library also copies the resources reachable from each page, so a page that depends on a font or an image keeps working after the move.
What a merge preserves, and what it drops
A correct merge parses each input, copies the page objects into a new document and renumbers every referenced object. Content streams are copied byte for byte, so text stays selectable and vectors stay sharp. What does not travel is document-level state. Outlines, named destinations, page labels, JavaScript, embedded files and AcroForm definitions live in the catalog, and the output gets a fresh catalog. Internal links that use explicit page numbers will point somewhere else. Form fields with identical names can overwrite each other. If you need a flat, uneditable result, flatten forms before merging.
Annotations that are attached to a page usually survive because they are part of the page object. Comments in a review workflow, however, may be stored in a separate annotation layer or in a proprietary system, so do not assume they will appear. Always open the merged file and check the pages that carried interaction, not just the first page.
Encrypted files, permissions and passwords
Encryption comes in two flavours. A user password is required to open the file; an owner password mainly controls permissions such as printing or copying. pdf-lib does not implement decryption, so a user-password file fails to load and the tool reports it. The workaround is to open the file in a trusted reader, authenticate, and export an unprotected copy. Removing an owner password may be technically possible in some tools, but permission flags express the author intent; merging does not create a licence to redistribute.
There is a practical test for this: if a reader asks for a password before showing any page, the file is encrypted with a user password. If it opens silently but discourages editing, only permissions are set. The first case must be resolved before merging; the second is a policy question rather than a technical one.
Ordering, naming and page ranges
Order is the main editorial decision. In a browser tool the on-screen list is the page order, so move rows instead of relying on filenames. A sensible convention is chronological for correspondence, cover sheet first for reports, and signed page last for contracts. Name the output for the recipient, not for your filesystem: invoice-2026-03-batch.pdf is clearer than final-final-2.pdf. If you need only a subset of pages, trim them before merging or use a split tool; merging everything and deleting pages afterwards wastes memory.
Keep a short checklist next to the merge button: first page identifies the bundle, last page carries the signatures, and every referenced attachment is actually included. These are the mistakes that survive a technically perfect merge.
File size, memory and performance
Expect the output to be roughly the sum of the inputs. Streams are not recompressed, so a 3 MB scan plus a 4 MB scan lands near 7 MB. Savings appear only when identical fonts or metadata can be shared, and they are usually small. That is a feature: recompressing scanned pages to save space would soften text and break OCR confidence. The real constraint is memory. Browsers must hold the source objects and the new document at once, so a batch of large scans can approach the tab limit. Desktop machines handle more than phones, and several open tabs make it worse.
If you regularly merge very large sets, a command-line workflow is more predictable because it streams data and reports errors clearly. The browser tool remains the better choice when the documents are sensitive and the batch is modest.
Troubleshooting a failed merge
Most failures fall into four groups: the file is encrypted, the file is damaged, the extension lies about the format, or the batch is simply too large. Open the suspect file in a desktop reader first; if it opens there, re-export it with the reader repair or print-to-PDF function and try again. Watch the tab memory indicator if your browser has one. Close other tabs, split the batch, or move to a command-line tool for very large sets.
- Password prompt or owner restrictions: export an unprotected copy before merging.
- Zero-byte or truncated file: re-download the original instead of repairing it.
- A .pdf that is really an image: convert it to a genuine PDF first.
- Merge completes but links break: rebuild bookmarks and internal links afterwards.
A terminal alternative shows how little the operation needs to do when the files are healthy:
qpdf --empty --pages a.pdf b.pdf 1-3 -- merged.pdf
Command-line tools such as qpdf and Ghostscript handle hundreds of megabytes more comfortably, at the cost of installing software and learning a syntax.
A browser merge is the right choice when the documents are sensitive, the batch is modest and you want a result in seconds. Use the PDF merge tool to try it with your own files. If you also embed images in HTML or CSS, the guide on data URIs and embedded images explains why base64 inflates file size, a useful background for judging PDF size too.