# Merge PDF

URL: https://hifreetools.com/pdf/merge-pdf

> Add two or more PDF files, put them in the order you want, and download a single combined PDF. Everything happens in your browser, so your documents are never uploaded to a server.

## Quick answer

To merge PDF files, add all the PDFs you want to combine, arrange them in the order you want them to appear, then click Merge to download one joined PDF. This tool does it entirely in your browser using the pdf-lib library: it reads each file's pages and copies them, in order, into a new document — so your files are never uploaded and there is no watermark or sign-up.

## Formula

- merged = every page of file 1, then file 2, … in list order
- total pages = n₁ + n₂ + … + nₖ
- file k → pages (n₁ + … + nₖ₋₁) + 1 to n₁ + … + nₖ

Each PDF you add is read locally as raw bytes and parsed in the browser. When you merge, the tool creates a brand-new empty PDF and then, for every file in the list order, copies all of that file's pages into the new document one after another. The pages keep their original size and content; only their order in the final file follows your list (use the ↑ ↓ controls to change it, or ✕ to drop a file). The combined document is then serialised to PDF bytes and offered as a download. No data is sent anywhere — the entire merge runs on your device.

## Inputs

- PDF files (2 to 100) — one of: PDF
- Pages per file; default 4, 6, 5

## Worked examples (computed by the page's own function)

- Pages per file = 4, 6, 5 → Merged PDF = merged.pdf, Total pages = 15, Files = 3, Page numbers of each file in the merged PDF = 1–4, 5–10, 11–15  (4 + 6 + 5 = 15 pages)
- Pages per file = 1, 10 → Merged PDF = merged.pdf, Total pages = 11, Files = 2, Page numbers of each file in the merged PDF = 1, 2–11  (1 + 10 = 11 pages)
- Pages per file = 2, 2 → Merged PDF = merged.pdf, Total pages = 4, Files = 2, Page numbers of each file in the merged PDF = 1–2, 3–4  (2 + 2 = 4 pages)

## Verification

Checked against 14 reference cases (expected values computed independently). Reviewed 2026-10-27. Latest change 2026-10-28: Moved to the schema file renderer with a sourced ledger. Same list order, ↑ ↓ reordering and remove; files can also be dragged to reorder or pasted. The page range each file lands on is shown before merging, and a PDF that cannot be read is refused when added instead of failing the merge. Up to 100 files.

## FAQ

**Are my files uploaded to a server?**
No. The merge runs entirely in your browser using the pdf-lib library. Your PDFs are read from your device, combined locally, and the result is downloaded directly — nothing is sent to or stored on any server.

**Is there a file-size or page limit?**
There is no fixed limit, but because the work happens in your browser, very large files use your device's memory. Merging typical documents (dozens of pages) is instant; extremely large scans on a low-memory device may be slow.

**Can I change the order of the files?**
Yes. Each added file appears in a numbered list. Use the ↑ and ↓ buttons to move a file up or down; the final PDF follows that order. Use ✕ to remove a file before merging.

**Will the merged PDF have a watermark?**
No. The output is a clean PDF with no watermark, no added pages, and no tracking. The pages are copied unchanged from your originals.

**Why won't one of my PDFs merge?**
The most common reasons are that the file is password-protected/encrypted or is corrupted. Remove that file, fix or unlock it separately, then add it again and retry.

**Does merging reduce the file's quality?**
No. Pages are copied as-is, so text stays selectable and images keep their original resolution. The merged file's size is roughly the sum of the originals.


## Sources

- [pdf-lib — create and modify PDFs in JavaScript](https://pdf-lib.js.org/)
- [pdf-lib — PDFDocument.copyPages](https://pdf-lib.js.org/docs/api/classes/pdfdocument)
- [Adobe — PDF 32000-1:2008 (ISO 32000-1) document structure](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Merge PDF", https://hifreetools.com/pdf/merge-pdf
