BASALT · JOURNAL

Reversing the page order of a PDF

2026-08-15 · reverse pdf page order

This comes up almost entirely because of duplex scanning: a stack fed the wrong way produces a document in reverse, or with the even pages reversed.

Whole document

qpdf input.pdf --pages . z-1 -- reversed.pdf

z is the last page, so z-1 is a descending range covering everything.

In Preview

Show thumbnails and drag pages into position. Fine for ten pages, impractical beyond that, which is what sends people to the command line.

The duplex case, which is the real problem

A double sided stack scanned as two passes gives you all the odd pages in order, then all the even pages in reverse. The fix is not simply reversing, it is interleaving.

Split into the two halves, reverse the second, then merge alternately. qpdf can do the whole thing in one command once you know the page count, but the arithmetic is easy to get wrong, and it is worth checking the output rather than assuming.

Checking

Look at the first three pages and the last three. Most ordering errors are visible immediately at the boundaries and invisible in the middle.

If the document has page numbers printed on it, they are the fastest check available. If it does not, check that the last page reads like a last page.

Bookmarks

Reversing does not reverse bookmarks, so a document with a table of contents will have every entry pointing at the wrong page afterwards. Rebuild them, or reverse before adding them.

Frequently asked questions

How do I reverse the page order of a PDF?

qpdf input.pdf --pages . z-1 -- reversed.pdf, where z means the last page, so the range descends across the whole document.

Why did my duplex scan come out in the wrong order?

A double sided stack scanned in two passes produces the odd pages in order followed by the even pages in reverse. The fix is to split, reverse the second half, and interleave, rather than simply reversing everything.

How do I check the page order is right?

Look at the first three and last three pages, since ordering errors are visible at the boundaries and invisible in the middle. Printed page numbers are the fastest check when the document has them.

Do bookmarks survive reversing a PDF?

No. Bookmarks continue pointing at their original page numbers, so every entry is wrong afterwards. Rebuild them, or reverse before adding them.

Doing it in Basalt

Basalt is a native macOS PDF toolkit: eighteen tools in one window covering merge, split, page organisation, compression, OCR, passwords, Bates numbering, forms, signing, watermarks and comparison. Every file is processed on your Mac, and the engine that opens documents holds no network entitlement at all, which macOS enforces at the code-signature level. Redaction destroys content rather than covering it, and an independent verifier proves the material is gone before a file is written. A one time $29 licence covers up to three Macs, free for the first 24 hours. basaltformac.com, or brew install --cask chipmunk1101/tap/basalt.

Redaction that proves itself

Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.

DOWNLOAD BASALT 2.3.0 BUY $29 FREE FOR 24 HOURS · MACOS 13+