PDF merge, split, and trim without uploads
Published: 2026-09-05
How to combine PDFs, extract page ranges, and drop unwanted pages with 1-based specs—why upload converters are risky for contracts, and how pdf-lib does the same work in the browser.
Contracts, invoices, ID scans, and board decks are often PDF. Before you send a file, you usually need a small surgery: stitch three attachments into one packet, pull pages 2–4 for a reviewer, or drop a blank cover sheet. Desktop apps can do that; so can dozens of “free PDF online” sites—if you are willing to upload the bytes to someone else’s server.
This guide explains merge, split (extract), and trim (remove pages) in plain language, how page ranges are specified, and why doing the work locally with a library like pdf-lib is the safer default for sensitive documents.
Three jobs, one file format
| Job | What you want | Typical output |
|---|---|---|
| Merge | Several PDFs → one document in a chosen order | merged.pdf |
| Split / extract | Keep only selected pages from one PDF | extracted.pdf |
| Trim / remove | Drop selected pages; keep the rest in order | trimmed.pdf |
All three operate on page trees, not on the text you see on screen. The tool copies page objects into a new PDF document and saves it. It is not OCR, not a word processor, and not a redaction suite—those are separate problems (see limitations below).
MIME type for the result is application/pdf (MIME types and file extensions).
Why upload converters are a bad fit for work docs
Online PDF utilities usually POST your file to a backend, process it, then offer a download (sometimes with a temporary URL). That is convenient for a public flyer. It is a poor fit for:
- NDAs, offer letters, and payroll PDFs
- Scanned IDs or medical forms
- Anything your company policy forbids leaving the device
Even if the site claims short retention, you cannot audit their logs, CDN caches, or subprocessors from the browser tab. The same privacy argument as for photos and secrets applies: prefer tools that keep bytes in RAM on your machine (Why “local only” matters for developer tools).
A local workflow loads the PDF with the File API, runs pdf-lib in the tab, and triggers a download from a blob URL. Open DevTools → Network while you work: you should see no request carrying the PDF payload.
Merge: order is the product
Merging concatenates documents in queue order. Page 1 of the second file becomes the next page after the last page of the first. Practical habits:
- Name files so the queue is obvious (
01-cover.pdf,02-body.pdf), then reorder if needed. - Prefer one merge pass for the final packet instead of merging A+B, then (A+B)+C repeatedly—fewer intermediate files to misplace.
- Watch page counts after merge: a missing attachment is easier to catch than a wrong legal clause buried mid-packet.
Browser merge tools typically show each file’s page count in the queue so you can sanity-check before Generate.
Split vs trim: extract or delete
Both modes start from a single PDF and a page spec. The difference is intent:
| Spec style | Split (extract) | Remove (trim) |
|---|---|---|
| Meaning | Pages listed are kept, in the order you listed them | Pages listed are dropped; remaining pages stay in original order |
Example 1-3, 5 |
New PDF = pages 1, 2, 3, then 5 | New PDF = everything except 1–3 and 5 |
| Empty result | Invalid if you listed nothing valid | Invalid if you remove every page |
Numbering is 1-based (first page is 1), matching how humans count in PDF readers. Specs use commas between items and hyphen ranges that are inclusive (7-9 means 7, 8, and 9). Order in a split spec is preserved: 5, 1-2 yields page 5 first, then 1, then 2—useful when you are assembling a custom excerpt.
Common mistakes:
- Treating the viewer’s “page label” (Roman numerals, section “A-3”) as the physical page index—use the absolute page number in the file.
- Inclusive range typos (
10-8is invalid; swap ends). - Removing a range that leaves zero pages—the tool should refuse that rather than emit an empty PDF.
What local page copy does not do
pdf-lib-style page copy is powerful and limited:
- Encrypted / password-protected PDFs often fail to load until unlocked elsewhere.
- Flattened appearance usually survives; complex interactive forms, some annotations, and exotic embeddings may not round-trip perfectly.
- This is not redaction. Deleting a page removes that page; blanking text on a page with a black rectangle in a viewer may leave recoverable content underneath. For legal redaction, use a purpose-built redaction workflow.
- Huge scans can stress browser memory; keep files reasonable or split work into smaller batches.
If you only need a smaller image export of a page, that is a different pipeline (render → compress)—see Lossy vs lossless image compression for bitmap tradeoffs, not PDF page trees.
Try it on LocalTools
Open PDF Toolkit:
- Choose Merge, Split, or Remove pages.
- Drop PDFs (or browse). For merge, add several files and reorder with the arrows; for split/remove, use one file.
- For split or remove, enter pages like
1-3, 5, 7-9(1-based, commas and inclusive ranges). - Click Generate PDF and save
merged.pdf,extracted.pdf, ortrimmed.pdf—built only in browser memory with pdf-lib.
Sensitive packets never leave the tab unless you upload the download yourself.
Related reading
- PDF Toolkit — merge, extract, and trim locally
- Why “local only” matters for developer tools — upload risk vs in-tab processing
- MIME types and file extensions —
application/pdfand related labels - Lossy vs lossless image compression — when you export page images instead of PDFs
- Reading EXIF, GPS, and camera tags from photos privately — another “inspect without upload” media workflow