PDF Merge
Published Updated
Combine PDFs and JPG or PNG images into one PDF in the order you set, with pages copied rather than redrawn.
How the merge works
Pages are copied, not redrawn. pdf-lib loads each PDF in the list and copies all of its pages, in list order, into one new document, so text stays selectable and images keep their original quality. Images in the list become single pages of their own.
Because the result is a fresh document, anything that lives at the document level rather than on a page stays behind.
What survives a merge
Checked with the same pdf-lib calls the tool uses, on a test PDF that had a title, an author and two bookmarks:
| Item | In the merged file |
|---|---|
| Page content, text, images | Kept as is |
| Page size and rotation of each page | Kept |
| Bookmarks (outline) | Lost: 2 in the source, 0 after |
| Title and author | Lost; the producer field reads pdf-lib |
| Fillable form fields | Not fillable: the merged file has no form dictionary (AcroForm), so pdf-lib and pdf.js list no fields, although the boxes and their values still show on the page |
| Links to another page of the same file | Kept: each opens the merged page that holds its target, also when the link uses a GoTo action or a named destination and when the same file is added twice. Web links keep their address |
| Digital signatures | No longer valid |
Pages, pictures and errors in a merge
The site's own PDF Merge component was run in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app) on generated files, and each merged PDF was read back with pdf-lib 1.17.1 and pdf.js 5.4.624. The four engines gave the same pages, links and fields; file sizes differed by at most 4 bytes.
| Files added, in this order | What the merged PDF held |
|---|---|
| A 12-page PDF (A4 pages and two landscape pages turned 90 degrees), a JPEG stored at 400 x 300 pixels with EXIF orientation 6, a 500 x 200 PNG with a transparent background, and an 8-page PDF with pages stored at 0, 90, 180, 270 and other rotations | 22 pages in list order. Every PDF page kept its size and stored rotation. The JPEG became a 300 x 400 pt page, the photo's size when turned upright, and its image data was byte for byte the original file; the PNG became a 500 x 200 pt page with its transparency kept as a soft mask |
| A 6-page PDF with internal links and four form fields, then the 12-page PDF | 18 pages. Every internal link opened the right page of the merged file: the 6-page file's link from its page 1 to its page 4 opened page 4, and the 12-page file's link from its page 1 to its page 9 opened page 15. The form fields showed with their values but were not listed as fields |
| A 6-page PDF, a password-protected PDF and 4,000 bytes of junk named .pdf | The list marked the second file Password-protected — unlock it first and the third Couldn't read this PDF; the merge left both out and gave the 6 pages |
| A 6-page PDF and 4,000 bytes of junk named .jpg | No file: the merge stopped with Couldn't process "junk.jpg". Please make sure it's a valid JPG or PNG image and try again. |
Time from pressing Merge PDF until the download link appeared, one run per engine:
| Files | Merged file | Chrome 156 | Chromium 153 | Firefox 155 | WebKit build |
|---|---|---|---|---|---|
| A 2,000-page text PDF (2,136,611 bytes) | 2,136,341 bytes | 1,060 ms | 1,068 ms | 1,314 ms | 1,424 ms |
| 40 scan-like JPEG pages (56,183,134 bytes) | 56,175,076 bytes | 129 ms | 100 ms | 160 ms | 150 ms |
| Both together, 2,040 pages | 58,311,371 bytes | 922 ms | 922 ms | 1,262 ms | 1,252 ms |
Labels, layers, tags and other document-wide settings
Settings that a source file keeps in its catalog do not come along, because the merged file starts as a new document. ISO 32000-1 (Table 28) lists those catalog entries apart from the page tree: page labels, the language, the tag structure, optional content (layers), the name dictionary that holds attached files, and the view a file opens with. Measured in Google Chrome 157 with the site's own PDF Merge component: a generated 4-page file that uses all of them, merged with a plain 2-page file and read back with pdf.js and pdf-lib. Firefox 155 and the WebKit build gave the same results.
| In the 4-page source | In merged-document.pdf |
|---|---|
| Page labels i, ii, 1, 2 | None: pdf.js reports no page labels |
| Language en-US and tags (a structure tree, with MarkInfo marked true) | No language, no structure tree, no MarkInfo |
| Two layers, one off by default, with a red square on the hidden one | No layer list (OCProperties), and pdf.js drew the hidden square: 14,400 red pixels on page 1, where the source shows none |
| notes.txt attached to the document | Not in the merged file |
| A 20-byte file attached to page 2 as an annotation | Kept on page 2, all 20 bytes |
| Open at page 3 with the bookmarks panel (OpenAction, PageMode) and show the title in the window (ViewerPreferences) | No open action, no page mode (pdf.js reports UseNone), no viewer preferences |
| An XMP metadata stream | None |
| Creation and modification dates of 2 January 2026 | Both set to the time of the merge |
| A file identifier (/ID) in the trailer | None |
| Version line %PDF-1.3 | %PDF-1.7 |
The same table marks the optional content dictionary (OCProperties) “required if a document contains optional content”. The merged file keeps the layer's marked content on page 1, and the layer itself, but has no such dictionary, and pdf.js showed the square that the source keeps hidden.
Merging files into one PDF
Step 1
Add PDFs and images
PDF, JPG and PNG files can be mixed. Each PDF shows its page count once read; a locked or broken one is marked in red.
Step 2
Put them in order
Use the up and down arrows to move a file, and the trash icon to drop it. The list order is the page order.
Step 3
Merge and download
All pages are copied into merged-document.pdf. The result card shows the total page count.
Useful before or after merging
- Reorder pages across the merged file: Organize PDF.
- Keep only some pages of a source: PDF Split.
- Number the pages of the result: PDF Page Numbers.
- Too big to email: Compress PDF to Size.
Merging PDFs: questions
Can I mix images and PDFs in one merge?
Yes. JPG and PNG files are added as one page each, sized to the image: one pixel becomes one point, so a phone photo makes a very large page. JPEG data is copied in without being compressed again.
Why is a file missing from the merged PDF?
Files marked with an error, such as a password-protected or damaged PDF, are left out when you press merge. Remove the password with Unlock PDF and add the file again.
Are bookmarks and the document title kept?
No. The pages are copied into a new, empty document, so bookmarks, the title and the author of the source files are not carried over. In a test, a PDF with two bookmarks and a title merged into a file with neither.
Is there a limit on how many files I can merge?
No number is fixed. Every file is read into memory and the merged PDF is built there as well, so the practical limit is the memory of your device. Very large scans are the usual reason a merge fails on a phone.
Do links and form fields still work after merging?
Links do: a web link keeps its address, and a link to another page of the same PDF opens that page in the merged file, also when it uses a named destination. Form fields keep their boxes and values on the page, but the merged file has no form dictionary, so they cannot be filled. Flatten the form first with Flatten PDF if you only need what was typed in.
Will a portrait phone photo come out sideways?
No. The orientation tag that phones add is read, and the page is turned to match it, the way your browser shows the photo. The JPEG data is still copied in unchanged.
What if one image in the list is damaged?
A broken PDF is marked in red as soon as it is added and is skipped. A broken JPG or PNG is only found when you press Merge PDF, and then the whole merge stops with a message naming the file, such as Couldn't process "junk.jpg"., and nothing is downloaded. Remove that file with its trash icon and merge again.
Does a PNG with a transparent background stay transparent?
Yes. A 500 x 200 PNG with transparent areas became a 500 x 200 pt page, and its transparency was stored as a soft mask beside the picture.
How long does a large merge take?
Merging a 2,000-page text PDF with a 40-page scan of 56 MB took 0.9 to 1.3 seconds after pressing Merge PDF, depending on the browser, and gave a file of 58,311,371 bytes with 2,040 pages.
Are rotated and landscape pages kept?
Yes. Each PDF page keeps its size and its stored rotation: landscape pages turned 90 degrees and pages stored at 180 and 270 degrees came out with the same values, in the order of the list.
Do page labels like i, ii, iii survive a merge?
No. A source whose pages were labelled i, ii, 1, 2 gave a merged file with no page labels at all (pdf.js reported none), so its pages are numbered by position only.
Why does content from a hidden layer show up after merging?
The merged file gets no list of layers (no OCProperties entry), so the setting that kept a layer off is gone. A red square on a layer that is off by default in the source was drawn by pdf.js on page 1 of the merged file in Chrome 157, Firefox 155 and the WebKit build: 14,400 red pixels, against none in the source.
Does a tagged, accessible PDF stay tagged after merging?
No. The merged file has no structure tree, no MarkInfo entry and no language entry, so the tags of a tagged source are not carried over. The page content itself is copied as it was.
Related guide
How to compress, merge and convert PDFs without uploading them. The guide lists what a merge keeps and what it leaves behind: bookmarks, title and author, form fields and signatures.