File & PDF Tools

Remove PDF Pages

Delete selected pages while preserving the rest of a PDF.

Remove PDF pages
Delete selected pages and keep the rest of the document.
Local browser processing

Remove PDF Pages

Delete selected pages and save the remainder as a new PDF without modifying the source file.

Limits

  • At least one page must remain
  • Comma-separated pages and ranges are supported
  • Bookmarks or links targeting removed pages may break

Removes chosen pages from a PDF and writes a new file holding only the pages you keep. Pages are listed as 1-based numbers and ranges such as 2,4-5; survivors keep their original order, page size and rotation. Useful for dropping cover sheets, blank scans or confidential appendix pages before a file is shared.

Page syntax: strict validation, no clamping

The page field accepts comma-separated tokens that are either a number or a number-hyphen-number range; 1-3,5,8 is valid, while a trailing hyphen raises a syntax error. Numbers are 1-based, and every endpoint is compared against the real page count before any page is copied: asking to remove page 7 from a six-page document fails with an out-of-range error instead of quietly ignoring page 7. Ranges may run backwards, so 5-3 expands to 5, 4, 3, and repeated numbers collapse, so 1,1,2 removes pages 1 and 2 only. In this mode the field starts empty and empty means nothing is marked for removal, which is reported as an error; the rotate and crop modes of the same panel prefill the full page range, because an empty box there would mean the whole document.

The output is reassembled, not patched

Removal never edits the source bytes. The tool parses the file with pdf-lib, resolves the expression into 0-based indices, creates an empty PDFDocument and copies the surviving page objects into it. Page-level data travels intact: MediaBox and CropBox, the /Rotate entry, content streams, and the fonts or images those pages reference. Catalog-level structures do not travel, because a newly created document has none of them: the outline tree, AcroForm fields, page labels and the Info entries such as Title and Author are all absent from the result. An explicit link destination like [4 0 R /Fit] is copied verbatim inside its annotation, so it still names an object number that no longer exists and the link goes dead.

What deletion leaves untouched

Kept pages always come out in their original ascending order, whatever the expression looked like: 5-3,1 and 1-5 yield the same document. That is the boundary between this tool and reordering, which rebuilds from a complete permutation. Geometry is not recomputed either: an A4 sheet stays 595.28 by 841.89 points, mixed page sizes stay mixed, and a page rotated 90 degrees stays at 90 degrees after its neighbours disappear. Numbers printed inside the content also stay as they are, so deleting a cover from a twenty-page file leaves the text of former page 2 sitting on what is now sheet one, and cross-references in the prose keep pointing at the old numbering. The only count that changes is /Count in the page tree.

Worked example

Removing pages 2 and 4-5 from a six-page report

Input
report.pdf, 6 pages, 595.28 by 841.89 pt, page 3 rotated 90 degrees. Pages to remove: 2,4-5
Output
report-remove.pdf, 3 pages in the order former 1, 3, 6; page 3 still at 90 degrees; Title and Author empty

The expression resolves to the 0-based indices 1, 3, 4, so the complement filter keeps 0, 2 and 5 and the copy count is 3. Because the result comes from PDFDocument.create(), the source Title, its AcroForm field and its outline are not carried over, while the /Rotate of 90 degrees and the MediaBox survive unchanged. The file name is derived by stripping the extension and appending the mode.

Limits and pitfalls

  • At least one page must remain: if the removal set covers every page, the tool stops with an error instead of emitting an empty document.
  • One file may be up to 100 MB and the whole selection up to 250 MB; password-protected or encrypted PDFs cannot be parsed and are rejected.
  • Page numbers follow the physical order in the page tree, not any numbering printed on the sheet; roman-numeral front matter still counts as pages 1, 2, 3.
  • Explicit link destinations inside annotations are copied without remapping, so a link whose target page was removed stays in the file but no longer jumps anywhere.
  • Outlines, form fields and page labels disappear along with the fresh document shell; re-add them afterwards if the file must stay interactive.

Related tools

When it goes wrong

I wanted to keep pages 3 through 8, so I typed 3-8, and the download contains every page except those.

CauseThe box is a removal set, not a keep set. The expression is parsed into 0-based indices, those indices go into a Set named removed, and the copied pages are source.getPageIndices().filter(index => !removed.has(index)) — the complement of what you typed. Nothing in the pipeline warns that the intent was inverted, because a valid removal set is a valid removal set.

FixType the pages that should disappear instead: for a 20-page file that keeps 3-8, enter 1-2,9-20. If it is clearer to name what survives, use the split tool with 3-8 instead.

A one-page PDF refuses to lose its page — every expression I try ends in the cannot-remove-every-page error.

CauseAfter parsing, the guard is if (removed.size === count). On a single-page document the only page number that passes the 1..count range check is 1, so the set can only ever have the same size as the page count and the guard always fires. The tool has no branch that writes a zero-page PDF, which is why pasting 1 cannot work.

FixThere is nothing to remove: a PDF cannot be emptied by this tool. Delete the file, or if you need a placeholder, take the first page away with a desktop editor and save what remains.

I dropped both attachments at once and only the first one came out — no error, no mention of the second file.

CauseMultiple selection is enabled only in merge mode. In remove mode files.value = acceptsMultiple ? selected : [selected[0]] keeps the first entry and discards the rest silently; the page count shown in the stat row is then that of file one, so a 40-page and a 12-page pair reads as 40 pages.

FixRun the tool once per file, or merge them first and delete across the combined page numbers, remembering that the second document continues after the last page of the first.

I deleted 40 of 60 pages and the file went from 38 MB to 34 MB, which is nothing like two thirds smaller.

CauseBytes are shed per object, not per page. copyPages walks the object graph reachable from the surviving pages and copies it whole, so a 30 MB scanned background image or an embedded whole font that one kept page still points at is carried over in full, while only objects referenced exclusively by removed pages disappear. Page count and file size are therefore unrelated quantities here.

FixFind out what actually dominates with pdfimages -list scan.pdf; if one shared image serves every page, delete-then-save cannot shrink it, and re-rasterising the kept pages or re-exporting at a lower scan resolution is the step that moves the number.

A contract opens in my reader without asking for a password, yet this tool rejects it saying encrypted PDFs are not supported.

CauseOpening without a prompt only means the user password is empty; the trailer still carries an /Encrypt dictionary, which sets the owner password and permission flags. pdf-lib raises an encrypted-document error as soon as it sees that entry, and the message is caught by the /encrypted|password/i branch of the file-error mapper.

FixStrip the dictionary first, for example qpdf --decrypt contract.pdf open.pdf (an owner-password-only file decrypts with an empty password), then load the result here; printing to PDF from a desktop reader also drops /Encrypt.

One concrete scenario

Cutting a scanned contract down to the body before it goes to a reviewer

A 48-page scan lands as a single 62 MB PDF, and only the body text should reach the reviewer: the cover, the two blank separators and the superseded table of contents have to go. Entering 1-2,17-19,44-48 marks 2 + 3 + 5 = 10 pages, so the saved contract-remove.pdf reports 38 pages, and what the reviewer opens as page 1 is former page 3. The removal side needs 10 numbers while the keep side would need 38, so the delete expression is the shorter one to type; switch to the split tool with 3-16,20-43 when you would rather state what survives. Either way the 62 MB source stays well inside the 100 MB single-file read ceiling.

Frequently Asked Questions

Will removing pages shrink the file?
Usually yes, but not proportionally: resources exclusive to removed pages (images, font subsets) go, while cross-page shared resources (one embedded font set) stay. Check file properties afterward if size matters.
Can I undo a wrong deletion?
The tool never touches the original — it only produces a new file, so the original is your undo. Rename outputs (report-v2) to avoid mixing them up before distributing.
How do I keep only certain pages (inverse deletion)?
Two ways: use the split tool to build a new document from the pages you want, or enter the pages to remove here and treat it as the complement. Bulk grouping favors split; spot tweaks favor remove.

Content reviewed: