Skip to main content

PDF Page Reorder

Rearrange pages in a PDF document with a visual drag-and-drop interface.

Reviewed by · Last reviewed

📄

Drop a PDF file here or click to upload

Rearrange pages in any order

How to Reorder PDF Pages

  1. Upload a PDF and watch the page list populate. Each row shows the current sequence position alongside the original page number, so you can always see which page was where.
  2. Move pages with the up and down arrow buttons on each row. Every click shifts that page one slot; to move a page several positions, click the arrow repeatedly.
  3. Verify the plan. The list order is the output order, top to bottom. No changes are committed until you save.
  4. Click "Save Reordered PDF" to generate and download a new document. The original file on your disk is left alone; the output is a fresh PDF whose page tree follows the order in your list.

What Reordering Does Under the Hood

The reorder operation in pdf-lib is a page-tree rewrite. The tool calls PDFDocument.load on your upload, which parses the header, XRef table, trailer, and catalog. It then builds a fresh PDFDocument and iterates your reordered indices, calling copyPages(source, [index]) to pull each page (and its referenced content streams, fonts, and image XObjects) into the new pool. Copied pages are appended with addPage so they sit under the new page tree in your chosen sequence. Because the copy preserves the page graph byte-for-byte, nothing re-renders and nothing is re-compressed. The PDF serializes with a regenerated XRef and is visually identical to the input, just with a different ordering.

Document Workflows That Need Reordering

  • Fixing a scanned packet where the auto-feeder pulled two pages in the wrong sequence.
  • Moving an executive summary from the end of a report to page one after a stakeholder asked for it up front.
  • Reorganizing a due-diligence binder so every contract sits above its corresponding amendment.
  • Putting a signed signature page at the end of a contract that was merged in the wrong order.
  • Reversing an academic appendix that numbered figures bottom-to-top after the author changed conventions.
  • Threading chapters of a serialized book PDF after a writer finalized the chronology of events.

Pitfalls to Watch For

Reordering changes physical positions but does not update anything that references pages by number. Internal hyperlinks that pointed at "page 12" in the source now land on whatever sits at physical index 12 in the output. Bookmarks (the outline tree) in pdf-lib do not migrate through copyPages, so the reordered document typically has no outline even if the source did. AcroForm fields stay attached to the correct page, but scripts that used page numbers as keys need rewriting. Digital signatures cover a byte range and are invalidated by any reorder. Encrypted files are rejected at load. If the document has a rendered table of contents on an early page, its numbers become wrong and need regenerating in the source application.

The PDF Page Tree in the Spec

ISO 32000-2 clause 7.7.3 defines the page tree as a hierarchical tree of page tree nodes ("/Type /Pages") whose leaves are individual page dictionaries ("/Type /Page"). The root of this tree is referenced from the document catalog's /Pages entry, and every compliant reader navigates it depth-first to assign physical page numbers. Reordering is a tree-rewrite operation: the leaves do not change, but their position under the root changes. pdf-lib produces a flat page tree (all leaves under a single root node) on output, which is the simplest valid form. PDF/A (ISO 19005) allows flat page trees and this tool's output remains PDF/A-compatible if the input was, as long as the document does not rely on structural features (bookmark continuity, form flow) that reordering breaks. The original page numbering shown in the UI comes from the document's page tree order at load time; the "new" number is the position the page will occupy after you save.

Where This Compares to CLI Reordering

For a one-off human reorder, clicking arrows in a browser UI is faster than constructing a CLI invocation. For any scripted or batch reorder, CLI tools dominate: qpdf --pages input.pdf 3,1,2,4-10 -- output.pdf rewrites the page order with a comma-separated index list; pdftk input.pdf cat 3 1 2 4-10 output output.pdf uses a space-separated list and accepts page ranges. mutool merge -o output.pdf input.pdf 3,1,2,4-10 is the MuPDF equivalent and is usually the fastest of the three on large documents. Adobe Acrobat Pro is the right tool when bookmarks and cross-references must be preserved and updated, because its reorder command also updates the outline tree and patches internal named destinations. If your workflow involves recurring reorders driven by a rule ("always move the signature page last"), a short script around qpdf is the right investment.

Frequently Asked Questions

Is the original PDF modified?

No. The tool only reads your file; the output is a separate download that you save under whatever name you want. Your original remains on disk untouched, so if you close the tab without saving the reordered version, nothing has changed. This also means you can experiment with multiple orderings without fear of losing the source.

Do internal hyperlinks still work after reordering?

Often they do not. Internal hyperlinks in PDFs typically point at a specific page index or a named destination. Reordering changes page indices, so a link that said "go to page 12" now lands on whatever physical page 12 contains after the shuffle. Named destinations move with their pages and keep working, but simple page-index links break. For documents with extensive cross-references, use a PDF editor that updates references during reorder.

Are bookmarks preserved?

pdf-lib does not currently copy the outline tree when it copies pages, so the reordered output generally has no bookmarks even if the source did. Page content itself is fully preserved. If bookmarks matter for your use case, rebuild them after reorder in a PDF editor, or use qpdf or Acrobat which preserve the outline tree and can patch page references during a reorder.

Can I reverse the page order of a whole document?

Yes, but clicking arrows page by page is tedious for long documents. For a full reverse, use qpdf --pages input.pdf z-1 -- output.pdf; the z-1 syntax means "last page back to first". For an in-browser approximation, move the last page to the top, then the next-to-last, and so on. For practical reverse-order use cases (like scan packets that came out upside down in sequence), the CLI path is much faster.

How many pages can I reorder at once?

There is no hard cap; the bottleneck is your browser heap. Chromium handles a thousand-page reorder without drama; Safari may slow down past a few hundred. If you hit a wall, split the document into halves with the PDF Splitter, reorder each half, and merge the halves back together. Thinking of reorder as "read graph, emit new graph" is why memory scales roughly linearly with page count.

Is the file uploaded anywhere during the reorder?

No. The entire reorder operation is pdf-lib running as JavaScript inside the tab, operating on an ArrayBuffer read from your local file through the File API. No fetch calls related to file content fire, no service worker intercepts the download, and the site analytics do not capture file bytes. You can run the reorder offline after the page finishes loading and it still completes.

Why does a single-page output sometimes look larger than expected?

If the copied page references a font subset that was shared across a much larger source document, pdf-lib may carry the full subset into the one-page output rather than re-subsetting to only the glyphs actually used on that page. That is a limitation of copyPages preserving whole font objects. Run the output through the PDF Compressor for a modest cleanup, or use mutool clean -g -gg for deeper subsetting.

Can I reorder pages in an encrypted PDF?

Not directly. pdf-lib cannot parse encrypted content streams without a key, and this UI does not prompt for a password. Unlock the document first through the PDF Unlocker once that feature ships, or run qpdf --decrypt --password=YOURPASS input.pdf plaintext.pdf locally, then drop the plaintext copy into the reorder tool. This separation keeps password entry scoped to the one page that is designed for it.

Do form fields stay attached to the right page?

Yes, because AcroForm fields reference their host page by object reference rather than by numerical index, and copyPages preserves that reference. The field remains at its original position on the page it was attached to; the page just sits in a different slot in the output. What will break is any external script that iterates pages by number and expects a specific field to be on page N.

Is reordering reversible if I save over my original?

Not without the source. The output is a new file with a new page tree; once you overwrite your original, the old page order is only recoverable from whatever backup you kept. Best practice: save the reorder under a new name (output.pdf, or your-file-reordered.pdf), verify it opens correctly in a reader, then replace the original if you are sure. File-system undo does not help once you overwrite.

More PDF Tools