Extracting pages from a PDF means reading a source document, copying only the page objects you name, and writing those pages into a brand-new file in the order you specified. The source PDF stays untouched on your device; the result is a separate new document containing only the pages you selected. Extraction differs from splitting in two ways: the output is a single new PDF rather than many files, and the page order is fully under your control rather than locked to the original sequence. Page numbers in the selection field use the same one-based numbering that ordinary PDF viewers display, so page 1 is the first page you would see when opening the document. A page-selection expression combines individual numbers and inclusive ranges separated by commas or whitespace, with a hyphen joining the start and end of each range. The same browser session parses that expression deterministically, copies each requested page object exactly once, and produces a fresh PDF that you can download immediately.

The grammar of a page-selection expression
The selection field accepts a small, well-defined language. Understanding the rules prevents silent surprises and rejected inputs.
Each token is either a single page number or a range. A page number is a positive integer written without decimals or signs; it matches the page numbers shown in your PDF viewer's page indicator. A range is two integers connected by a hyphen, where the first integer is less than or equal to the second. The hyphen denotes an inclusive ascending sequence, so "3-5" selects pages 3, 4, and 5 in that order. Tokens are separated by commas or any whitespace, including spaces, tabs, and newlines; both separators behave identically, and extra whitespace does not change the result.
Token order is meaningful. The parser records the order in which tokens appear and emits the corresponding pages in that order. The expression "5, 2-3" produces a new PDF whose first page is original page 5, followed by original pages 2 and 3. This makes it possible to assemble a custom sequence without first rearranging the source document.
The parser is strict on purpose. Descending ranges such as "5-3" are rejected rather than silently reversed. Decimal values, negative values, malformed ranges, and pages outside the loaded document all trigger an explicit error message. The input field accepts at most 4,000 characters; over-limit input is neither truncated nor partly applied. If a selection is longer than that limit, the work needs to be split across multiple passes.
| Pattern | Meaning | Example output | Status |
|---|---|---|---|
| 7 | Single page | Page 7 only | Accepted |
| 1-5 | Inclusive ascending range | Pages 1, 2, 3, 4, 5 | Accepted |
| 3, 7 | Two tokens, order matters | Page 3 then page 7 | Accepted |
| 5, 2-3 | Single page plus range | Page 5, then pages 2 and 3 | Accepted |
| 5-3 | Descending range | — | Rejected |
| 1.5 | Decimal value | — | Rejected |
| 999 (beyond last page) | Out-of-range page | — | Rejected |
Extract pages from a PDF in three steps
The workflow is short and entirely local. Each step maps directly to one of the verified operating steps for the browser-based extraction tool.
- Choose a local PDF that is unencrypted, no larger than 50 MiB, and no more than 500 pages. The browser reads the original bytes directly from your device, so the file must already be saved somewhere on disk.
- Enter a page-selection expression in the field. Use one-based numbers that match the viewer's page count, and combine single pages with inclusive ascending ranges in the order you want them to appear in the output.
- Run the extraction, review any duplicate-page notice that appears, and download the new PDF. Changing the expression or running again replaces the previous output, so the latest download always matches the latest result.
What the browser actually does to your pages
When you run the extraction, the browser first validates the file's PDF MIME type or extension and confirms the file falls within the 50 MiB byte limit before any page objects are touched. The library that does the heavy lifting, pdf-lib's PDFDocument API, then loads the source bytes with encryption bypassing disabled, which means a password-protected file cannot be opened by guessing the password. Once loaded, the document must contain between 1 and 500 pages; otherwise the tool refuses the file rather than truncating it.
The parser walks your selection expression, ignoring whitespace and tracking the order of every unique page. It converts each one-based token into a zero-based index for the underlying library, copies the page objects in the recorded order, and inserts them into a freshly constructed PDFDocument. Each copied page object retains its 90-degree rotation, crop box, media box, page graphics, and ordinary page resources. Pages are not rasterized into screenshots, so vector content stays vector content.
When all selected pages have been copied, the new document is saved into a temporary local Object URL that the browser exposes for download. That URL is released when it is replaced by a newer extraction, when you load a different source file, or when you close the page. The source bytes, the selection text, the source preview link, and the result are all cleared together when a new file is chosen, and guards prevent an older asynchronous load or save from overwriting newer state.
Boundaries the tool enforces: size and page count
The input limit is exactly 50 MiB, which is 52,428,800 bytes, and the decoded document limit is exactly 500 pages. These are explicit local-processing boundaries rather than soft targets. A file at either boundary is accepted; a file that exceeds either boundary is rejected, not shortened. The two limits are independent: a 49 MiB file with 600 pages is rejected for page count, and a 51 MiB file with 100 pages is rejected for size.
The output is not capped by the input limit because pdf-lib copies each selected page's resource objects along with the page itself. Fonts and images attached to a page must travel with it, which means a one-page extraction from a resource-heavy document can still produce a sizable file. Conversely, extracting a hundred plain text pages from a 200-page document does not necessarily produce a result exactly proportional to the page count. File size does not necessarily scale in direct proportion to page count.
Browser memory availability also varies by device and tab workload. If a large extraction stalls or returns an out-of-memory error, splitting the work into two or more passes typically completes more reliably than retrying the same input.
| Boundary | Value | At the boundary | Above the boundary |
|---|---|---|---|
| Input file size | 50 MiB (52,428,800 bytes) | Accepted | Rejected |
| Input page count | 500 pages | Accepted | Rejected |
| Selection field length | 4,000 characters | Accepted | Rejected, not truncated |
| Output file size | Not explicitly capped | Depends on copied resources | — |
First-occurrence rule for repeated pages
Duplicate tokens are common when a range overlaps with a single page or another range. The parser applies a deliberate first-occurrence rule: the first time a page number appears in the expression, that page is selected; every later occurrence of the same page number is ignored. The result then reports which page numbers were duplicates so you can confirm whether the repeats were intentional.
The expression "3, 1-3" therefore produces pages 3, 1, and 2 in that exact order, and the result reports page 3 as a duplicate. This prevents an accidental overlap from silently adding repeated pages to the output, while preserving the exact order in which each unique page first appeared in the expression.
| Expression | Unique pages selected | Output order | Reported duplicates |
|---|---|---|---|
| 3, 1-3 | 3, 1, 2 | 3, 1, 2 | 3 |
| 1-5, 3 | 1, 2, 3, 4, 5 | 1, 2, 3, 4, 5 | 3 |
| 2, 2, 2 | 2 | 2 | 2 (twice) |
| 10-12, 11-13 | 10, 11, 12, 13 | 10, 11, 12, 13 | 11, 12 |
If duplicate pages in the output are genuinely required, this tool will not produce them. A page-reordering or duplication workflow designed for that purpose is the right tool for the job.
What survives a new PDF, and what does not
Each copied page object brings its rotation, crop box, media box, page graphics, and ordinary page resources along with it. A page that was rotated 90 degrees in the source remains rotated 90 degrees in the new document; a page that used a custom crop box keeps that crop box; ordinary embedded images and fonts attached to a page travel with the page object.
Several document-wide features, however, depend on objects outside the pages you selected. pdf-lib's PDFForm class documents that dynamic XFA forms are not a supported preservation target. AcroForm fields, annotations, scripts, embedded files, layers, page labels, bookmarks, document outlines, cross-page destinations, and links may also rely on objects that do not survive extraction cleanly. Digital signatures will not remain valid because the new PDF is a different document at the byte level, and any signature that pointed at the original byte stream is broken by construction.
Password-protected or encrypted files cannot be opened by bypassing encryption, so an encrypted source has to be unlocked first. Damaged or unsupported files can fail to load at all. The tool therefore makes no promise that every interactive, navigational, signed, or archival property survives. Before relying on the result, open it in your target viewer, confirm the order and appearance, test any links or form fields you need, and retain the original PDF. Use a specialist PDF editor when preservation of signatures, XFA, accessibility structure, portfolios, attachments, or regulated archival conformance is required.
When extraction is the right job, and when it is not
Extraction is purpose-built for one task: copying selected pages from a source into a single new file in a chosen order. It fits well when you want to hand a colleague three specific slides, share one chapter from a long report, or assemble a custom excerpt from several points in a document. The Extract PDF Pages tool is designed for that subset precisely. For a more step-focused walkthrough of the same task, see how to extract PDF pages into a new file.
If your task is different, the rest of the local PDF toolkit covers it. To remove unwanted pages from a document, use a deletion workflow. To break a document into many smaller files at fixed boundaries, use a split-by-range workflow. To rearrange an existing document without removing anything, use the page-reordering tool. To rotate, crop, or resize the output, those tools operate on the new PDF after extraction. When duplicate copies of the same page are needed in the output, the first-occurrence rule will not give them to you, so choose a duplication workflow instead. When preservation of signatures, XFA forms, or accessibility tagging matters, use the original authoring software rather than a page-extraction tool.
For a deeper look, see Change PDF Page Order: A Complete Browser-Based Method.