Merge and Extract PDF Pages in the Browser: The Range Rules Our Tool Follows

You need to send one document, and it is spread across three PDFs. Or you need pages 4 through 7 of a 60 page contract and nothing else. Both jobs are small, and both are usually solved by uploading private files to a random website and hoping the deletion policy is real.

Our PDF tools page takes a different approach. Every operation runs in your browser through the pdf-lib library. No file is uploaded, and you can verify that claim yourself. Open the browser network tab, run a merge, and watch for any outbound request. There is none, because the code that reads and writes the PDF runs on your machine.

What the tool actually does

Two operations exist: merge and extract pages. That is the whole list, and it is worth being precise, because an earlier version of this article promised compression in its title. The tool does not compress PDFs. If you need a smaller file, use a dedicated image or PDF compressor, because pretending merge and split shrink files would be false advertising of our own product.

The merge rules

1. Drop or select your PDF files. Anything without the PDF MIME type is filtered out before it enters the list.

2. Each file gets its page count read on arrival, so the list shows pages and file size per item and a running total.

3. Set the order with the up and down arrows. The merged document follows the on-screen order exactly, top to bottom.

4. Press merge. The button requires at least 2 files and stays disabled below that.

5. The merged PDF downloads immediately.

Order is the only thing people get wrong here. If the chapter file sits below the appendix file, the merged document puts the appendix first. Fix the list order before merging, because there is no undo step after the download.

The page range syntax

Extraction takes a text range. The parser follows four rules, and knowing them saves a failed run:

  • Separate entries with commas, as in 1-3, 5, 7-9.
  • Use a hyphen for an inclusive range. For a 9 page file, 1-3 means pages 1, 2, and 3.
  • Numbers outside the document are dropped silently. On a 9 page file, the entry 12 adds nothing and raises no error.
  • Duplicates are removed and the final page list is sorted, so 5, 1-3, 5 produces the same output as 1-3, 5.

When you load a file, the range field starts pre-filled with 1 through the full page count. Replace it before extracting.

The half presets and the odd-page catch

Three preset buttons fill the range field for you. On a 10 page document, First Half sets 1-5 and Second Half sets 6-10. On an 11 page document the split shifts, because the code uses Math.ceil: First Half sets 1-6 and Second Half sets 7-11. The first half of an odd-length document is always the larger half. The third preset, Only Page 1, is built for pulling a cover page or a signed first sheet out of a long file.

The limits we state up front

The tool's own FAQ panel answers the two questions that matter. There is no technical limit on how many PDFs you merge, but very large files strain browser memory, and a tab can crash if you feed it hundreds of megabytes. Encrypted PDFs are rejected. You must remove the password before loading the file, because pdf-lib cannot open a document it cannot decrypt.

Two more limits come from the design. Everything depends on your browser staying open, so a mid-process refresh loses the file list. And processing speed is bound to your device, not a server farm, so a 500 page merge takes longer than a 5 page one on the same machine.

When you should use something else

Use a desktop editor when you need editing, OCR on scans, form field creation, or digital signatures. Use a server-based service only when your legal or compliance rules require a documented processing chain, and then read where the files land. For merge and extract jobs on files you are allowed to open, client-side processing removes the upload risk entirely.

Checklist before you extract or merge

  • The file list order matches the order you want in the final document.
  • The range contains only numbers that exist in the source file.
  • Ranges are comma separated with hyphens for spans, no spaces needed.
  • The PDF has no password, or the password has been removed first.
  • Large merges are saved in smaller batches if the tab struggles.

Run your next merge or page extraction on the [PDF tools page](/en/pdf-tools). If you hit a file the range parser rejects, or a merge size where the tab gives up, tell us the page count and file size. That data decides what gets optimized next.