Runs in your browser with pdf.js and pdf-lib

Merge PDF Files Online — choose the pages and order

Drop in several PDFs, drag them into sequence, preview and trim pages from each one, then combine them into a single document — right in your browser.

See how it works
  • PDF files aren't uploaded to our server
  • Drag files into order
  • Pick page ranges per file
  • Free, no account

Collate files into one PDF

Add your PDFs — each becomes a numbered card you can reorder, preview, and trim.

Files merge in card order, starting with File 1.

Drop your PDFs here

or browse — you can add several PDFs at once

What this tool actually does

Combining files is the easy part — choosing what goes in is the point

Joining whole documents end to end takes one click almost anywhere. This tool is for when you need to decide the order, drop a few pages, and check the content first.

One file, from several sources

An invoice from one system, a scanned form from another, a report exported from a third — these need to become one document, but rarely in the order they were saved, and rarely with every page intact.

Upload your PDFs, and each becomes a numbered card with its own page preview. Drag cards to set the file order, type a page range like 1-3, 5, 8-10 to pull only what you need from that file, or step through pages and delete one directly. pdf.js renders the previews and pdf-lib assembles the final file — both run in your browser tab, so your PDF files are processed locally and aren't uploaded to our server.

What you can set before merging

File order

Sort by name or size to get close, then drag any card by its handle or use its arrow buttons. The final document follows the card numbers on screen.

Page content

Step through each file's pages with the arrows before you commit, so you're confirming actual content, not just a filename.

Page range

Type a range like 1-3, 5, 8-10 in a file's card to pull only those pages. The preview updates to show exactly the pages you selected.

Unwanted pages

Navigate to a specific page in any file and delete just that one — the page-range field updates automatically to match.

Final name

Rename the merged file right where it's previewed, then download it — no need to rename it again after it lands on your device.

How to merge PDFs in four steps

Your file cards stay on screen after merging — adjust a range or the order and merge again anytime.

Add your files

Drop several PDFs onto the upload area, or click Select PDFs to browse. Larger files or bigger batches use more browser memory.

Each file becomes a numbered card with a live page preview.

Order and check each file

Set your final sequence, then work through each card:

  • Drag a card by its handle, or use its arrow buttons, to change its position.
  • Use the page arrows to step through pages, or delete the page currently shown.
  • Type a page range at the bottom of the card to include only certain pages.

Merge

Click Merge PDFs once the order and ranges look right. pdf-lib copies the selected pages from each file, in card order, into one new document.

The merge runs in this tab — your PDF files aren't uploaded to our server.

Check, rename, download

Page through the merged file in the preview, rename it if you like, then download it. Your source files are untouched.

  • Page-by-page preview
  • Rename before download
  • Nothing uploaded

Separate files, one sequence

Three unrelated PDFs, reordered and trimmed into a single document.

As uploaded 3 files
Multiple separate PDF files before merging
Report.pdf, Invoice.pdf, Appendix.pdf — no particular order, no trimming yet.
Merged
After merge 1 file
Single merged PDF document with pages in order
Final-Document.pdf — the pages you chose, in the order you set.

Where you need the order to be right

Cases where combining files is only useful if it's combined in the right sequence, with the right pages — plus a range tip for each.

SituationWhat you're combiningRange tip
E-book chaptersSeparate chapter PDFs into one continuous reading file, in reading order.If every chapter repeats a title page, start later chapters at page 2, e.g. 2-14 on a 14-page chapter.
Client invoicingSeveral invoice PDFs for the same customer or billing period.Name sort understands numbers, so INV-2 comes before INV-10.
Office paperworkReports, letters, forms, and slide exports into one packet.Move the cover letter to File 1, then delete blank pages from the scans.
Quotes and estimatesAn estimate, its pricing sheet, and supporting attachments.Keep only the summary page of a long pricing sheet, e.g. 1.
BOQ documentationBill-of-quantities sheets, item lists, and supporting project files.Put the abstract sheets, e.g. 1-3, ahead of the detailed item lists.
Project reportingProject plans, approvals, and supporting PDFs into one submission.Approvals often sit on the last page — check it in the preview before setting a range.
Scanned recordsScanned forms, certificates, and related documents from a shared scanner.Duplex scans often include blank backs; step through and delete them.
Periodic reportsMonthly or departmental PDF reports into one archive file.Name files like 2026-01, 2026-02 so Name (A to Z) gives month order.

Three ways people actually use it

The mechanics stay the same; what changes is which pages you're pulling from which file.

Full documents, in sequence

Every page from each file goes in, and the only decision is order.

  • Book chapters into one manuscript
  • Monthly reports into one archive
  • Scanned form batches into one file

Selected pages only

You need specific pages out of a longer source document.

  • Relevant clauses out of a long contract
  • One chapter out of a full textbook scan
  • Specific exhibits out of a case file

One file split around another

Need one file's pages placed around another file? Add the same PDF twice and give each copy a different range — e.g. form pages 1-3, then the signed page, then form pages 5-10.

  • A signed page placed inside a scanned form
  • A cover letter ahead of a resume
  • Supporting exhibits after a main filing

Page range syntax

How to write a page range

Each file card has a range field so you can merge only the pages you need — here's exactly how it's read.

A continuous range

Type 1-3 to include pages 1, 2, and 3 from that file — inclusive on both ends.

Mixed ranges and single pages

Type 5, 8-10 for page 5 plus pages 8 through 10. Pages always keep their original order — 5, 1-3 still outputs 1, 2, 3, 5. To reorder pages inside a file, use Organize PDF first.

Leave it as-is for the whole file

Each range field starts filled with every page in that file. Don't touch it if you want the entire document included.

Invalid range handling

A reversed range like 10-5, or page numbers past the end of the file, are skipped. If nothing valid is left, the card is marked and the merge waits until you fix it.

When the merge doesn't behave

Identify the problem, then use the matching fix.

Symptom
Why it happens
Fix

The merge is slow or the tab freezes

Very large PDFs or many files at once use a lot of browser memory, since merging happens on your device.

Merge fewer or smaller files at a time, or close other browser tabs first.

A card is marked with an invalid range

The range field has no page numbers that exist in that file, so there is nothing to copy.

Use numbers between 1 and the file's page count, shown under the range field.

Choosing a sort option undoes manual moves

Name or Size sorting rewrites the whole card order when you pick it.

Sort first to get close, then do your manual moves last.

The wrong page gets deleted

Delete this page removes whatever page is currently shown in that card's preview.

Use the preview arrows to land on the exact page first — the card shows its original page number.

The merged file is quite large

Merging copies existing content without recompressing it, so the output is roughly the sum of the pages you kept.

Run the result through Compress PDF afterward.

Files come out in the wrong order

The merge follows the card numbers (File 1, File 2, …) at the moment you click Merge.

Check the card numbers and each range field right before merging.

A password-protected PDF won't open

Most password-protected or encrypted PDFs can't be opened by the in-browser PDF libraries, so they're rejected when you add them.

Remove the password with an unlock tool, then add the unlocked file here.

Pages come out upside down

A source PDF's own page rotation is kept as-is when its pages are copied into the merge.

Rotate the affected pages with our Organize PDF tool before merging.

Get the sequence right the first time

Habits that save a second round of merging.

Trim on the cards, not afterward

Setting ranges on each card before merging is faster than fixing the merged file later — and if something's off, your cards are still there to adjust and re-merge.

Add the same PDF twice to split it

To place another file in the middle of a document, add that document twice and give the copies different ranges — e.g. 1-3 and 5-10 — with the other file between them.

Check every card's preview before merging

Step through each file's pages to confirm you're merging the right content — a quick look here avoids redoing the merge.

Remember pages keep their original order

A range only picks pages; it never reorders them inside a file. If page 5 must come before page 1, reorder that file in Organize PDF first.

Unlock protected files first

A password-protected source file usually can't be read or previewed here — remove the password before adding it.

Rename it where it's previewed

The file name field sits right next to the merged preview — rename it there instead of renaming the file on your device afterward.

Common questions about merging PDFs

If something's not covered here, the troubleshooting section above likely has it.

Does this tool upload my PDFs anywhere?

No. The PDF processing happens in your browser: pdf.js renders the previews and pdf-lib builds the merged file. Your PDF files are not uploaded to our server.

Is there a limit on how many files I can merge?

There is no fixed file-count limit in the interface, but your practical limit depends on available browser memory. Large PDFs or large batches may be slower or may not finish on lower-memory devices.

Can I change the order the files merge in?

Yes. Sort by name or size for a rough order, then drag a card by its handle or use its arrow buttons. Files merge in the order of the card numbers shown on screen, starting with File 1.

Can I merge only some pages from a file, not the whole thing?

Yes. Each file card has a page-range field. Type something like 1-3, 5, 8-10 to include only those pages from that file. Pages always keep their original order within that file.

Can I put one file in the middle of another?

Yes. Add the outer PDF twice, give the first copy the pages before the insert (for example 1-3) and the second copy the pages after it (for example 5-10), then place the other file between the two cards.

Can I see the pages before merging?

Yes. Each file card renders a page preview with navigation arrows and shows the original page number, so you can check content and delete a specific page before merging. The merged file has its own preview too.

Which browsers does this work in?

It is built for current versions of Chrome, Edge, Firefox and Safari, on desktop and mobile. Very old browsers may not be able to load the PDF engine, and large or complex PDFs can be slow on phones.

Build notes

The write-up on how this was built

Because the previews, reordering, and merge all run client-side, I wrote up the core implementation — reading files with the browser File API, rendering previews with pdf.js, drag-and-drop ordering, and assembling the output with pdf-lib.

Published on freeCodeCamp

How to Merge PDF Files in the Browser Using JavaScript

Covers client-side PDF processing, browser file APIs, handling large files, and why doing this in the tab keeps documents on the user's device.

Read the write-up on freeCodeCamp

Written by Bhavin J. Sheth, founder of AllInOneTools