Skip to main content
PPDF123

Rearrange PDF Pages

Rearrange Pages reorders the pages of a PDF with qpdf. It can follow a custom page list, reverse the file, sort for duplex or booklet printing, split odd and even pages, drop the first or last page, or duplicate pages.

Drag and drop a file here, or click to choose

Accepts PDF · up to 500.0 MB per file

You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.

Rearrange Pages builds a page list and copies it with qpdf. Every mode on the form is implemented: `REVERSE_ORDER` (default), `CUSTOM` (the page list you type, in that order), `DUPLEX_SORT` (1, last, 2, second-to-last, …), `BOOKLET_SORT` (saddle-stitch imposition order, padded to a multiple of four), `ODD_EVEN_SPLIT` (odd pages, then even), `REMOVE_FIRST`, `REMOVE_LAST`, `REMOVE_FIRST_AND_LAST` and `DUPLICATE` (each page emitted twice in place).

`CUSTOM` and `DUPLICATE` read the page list (`pageNumbers`, or `order` over the API). `CUSTOM` without a list is rejected; only `REVERSE_ORDER` (or no mode at all) reverses. `DUPLICATE` without a list duplicates every page, while with a list it keeps only the listed pages, each twice in a row. A repeated number in a `CUSTOM` list is used once. An unknown `customMode` is rejected instead of silently reversing, and a mode that would leave no pages (for example removing the first page of a one-page file) is an error.

Booklet sort only reorders pages; it does not place two pages on one sheet. Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first.

Extract Pages uses the same endpoint with a page list and no mode selected.

CUSTOM is also a selection tool: pages you do not list are not in the result. To move the last page of a 12-page file to the front and keep everything, type `12,1-11`. Typing only `12,1` gives a 2-page file. A page that does not exist is rejected with a 400 (`Page 13 does not exist; the document has 12 pages.`), and text that is not a page list is rejected with `invalid_page_selection`.

Worked orders for a 5-page file, taken from the mode definitions: Reverse gives 5,4,3,2,1; Odd/even gives 1,3,5,2,4; Duplex sort gives 1,5,2,4,3; Remove first gives 2,3,4,5; Remove last gives 1,2,3,4. For an 8-page file Booklet sort gives 8,1,2,7,6,3,4,5. For a 6-page file it first appends two blank pages in the size of the last page, so the result has 8 pages, two of them blank.

Duplex sort alternates the first remaining page with the last remaining page. It can repair a stack that was scanned in two passes through a one-sided feeder, fronts first and then the backs in reverse, because pairing the first scanned page with the last puts each front next to its back. If a scanned page is upside down, Rotate is the tool, not this one.

Pick a mode by the problem. Pages in a fixed new order: Custom. Whole file backwards: Reverse. Cover or back page gone: the Remove modes. Print order for a folded booklet: Booklet sort, followed by your printer's own two-up layout. Dropping or keeping a block of pages without caring about order: Remove Pages or Extract Pages. Cutting the file into several files: Split.

The modes that leave no pages return an error: Remove first and last on a 2-page file, or Remove first on a 1-page file. The form lists a minimum page count for each of those modes.

Features

  • qpdf subset: reverse, custom order, duplex, booklet, odd/even, remove first/last, duplicate
  • Custom order and Duplicate use the page list
  • Unknown modes are rejected with an error
  • Anonymous API at /api/v1/general/rearrange-pages

When to use this tool

  • Reverse a stack scanned last-page-first
  • Put odd pages then even pages in one file
  • Drop the cover page or the last page in one step
  • Duplicate every page once for a review copy
  • Move a late-added appendix to the front of a report with a Custom list
  • Restore reading order on a stack scanned in two feeder passes with Duplex sort

How do I rearrange pages in a PDF?

  1. Upload the PDF whose page order you want to change, duplicate, or reverse.
  2. Pick a mode. For Custom order or Duplicate, fill in the page list (or drag thumbnails to set the order).
  3. Click Process.
  4. Download and check the page order against the mode you chose. Page numbers in the result are new positions, not the old ones.
  5. If a Custom result is too short, you left pages out of the list; type the full order, for example `12,1-11`, and run it again from the original.

Limits and edge cases

  • Booklet sort reorders only; no two-up imposition
  • A mode that leaves no pages is an error
  • Password-protected files need the password
  • Custom order drops every page you do not list
  • Duplicate with a page list drops the pages outside the list
  • A page number past the last page is an error, not a skip
  • Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.

Examples

  • A 4-page file in Reverse becomes 4,3,2,1
  • Odd/even on 4 pages becomes 1,3,2,4
  • Duplex sort on 6 pages becomes 1,6,2,5,3,4
  • Custom `12,1-11` on a 12-page file moves the last page to the front and keeps all 12
  • Booklet sort on 8 pages becomes 8,1,2,7,6,3,4,5

Privacy for this tool

Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.

Frequently asked questions

What happens if I pick Custom order without a page list?
The request fails with a bad-request error saying pageNumbers is required. Custom order never reverses; enter the list, for example 3,1,2.
What does Duplicate do?
Each page in the page list is emitted twice in a row, and pages not in the list are left out. With the list `2`, the result is page 2 twice. An empty list duplicates every page: 1,1,2,2,…
Why is my result shorter than the original after Custom order?
Custom keeps only the pages you list. To reorder everything, list every page, for example `3,1,2` for a 3-page file.
What does Duplex sort do to a 5-page file?
It alternates from both ends and produces 1,5,2,4,3.
What happens to a booklet whose page count is not a multiple of four?
Booklet sort adds blank pages at the end, sized like the last page, up to the next multiple of four. A 6-page file becomes 8 pages.
Can I type a page that is too high?
No. A page number beyond the last page returns a 400 error naming it, and nothing is produced.
Is booklet imposition implemented?
Booklet sort produces the print order for saddle-stitch booklets (8 pages become 8,1,2,7,6,3,4,5). It reorders pages; it does not put two pages on one sheet.
What happens if I send an unknown mode over the API?
The request fails with a bad-request error naming the mode; it no longer falls back to reversing.

Last updated:

Call this from code

Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.

curl -X POST "https://pdf123.xyz/api/v1/general/rearrange-pages" \
  -F "[email protected]" \
  -F "customMode=REVERSE_ORDER" \
  -F "pageNumbers=all" \
  -o output.pdf

Also available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference

Use it from an AI agent

Skill

Claude Code, Codex, Cursor and other AI agents can run Reorganize Pages for you with this skill: /skills/pdf123-rearrange-pages.md

All agent skills

Files are used only for this processing job and deleted automatically afterward.