How to Sort PDF Pages by Date, Number or Name Automatically
Reorder scanned or merged PDF pages by a value printed on them, such as a date, invoice or account number or a name, keeping documents together.

How to Sort PDF Pages by Date, Number or Name Automatically
Scanning a box of paperwork rarely produces a useful order. Invoices come out in the order they were stacked, statements from different accounts are mixed, and student reports are in whatever order the folder happened to be in. Dragging hundreds of page thumbnails into place is exhausting. If each page carries a key, such as a date, an invoice number, an account number or a name, the computer can do the sorting. This guide shows how with PDF Sort Pages by Content.
Choosing the key
The key is the value pages are sorted by. Built-in options:
- First date on the page, for chronological order.
- Invoice number, after labels such as Invoice No. or Inv.
- Account number, after Account or Acct.
- Name, after labels such as Name:, Customer:, Student: or Employee:.
For anything else, write your own pattern, a regular expression with the key in brackets. For example, Ref:\s(\S+) sorts by the value after "Ref:", and Policy\sNo\.?\s*(\d+) by a policy number.
How values are compared
- Text uses natural order, so A2 comes before A10 and Smith comes after Jones.
- Numbers compares numerically, so 9 comes before 100.
- Dates converts every date to year-month-day before comparing, so 3 March 2026 and 03/03/2026 sort correctly together. Choose day-first or month-first to match the documents.
Tick descending for newest-first or Z-to-A order.
Keeping documents together
Many documents run to more than one page, and only the first page carries the key. With the keep-together option, a page without a key travels with the page before it, so a three-page statement moves as a block. The report shows which pages were treated as continuation pages.
Scanned pages
Pages without a text layer can be read with OCR during sorting. It takes a few seconds per page, and OCR may misread a digit, so look over the key column in the report before relying on the order.
Checking the new order
The report lists every page in its new position with its old page number and the key found. Pages that had no key at the start of the file stay at the start. If keys look wrong, make the pattern more specific, for example by including the label.
Example
A 96-page scan of supplier invoices, mostly one page each but some two pages, is sorted by invoice number as numbers. Eighty-one key pages are found, fifteen continuation pages stay with their invoices, and the sorted file runs from INV-1001 to INV-1081, ready for filing.
After sorting
Sorting often comes before splitting or renaming. Once pages are in order, split the file into documents by text, or rename them from their content.
Common uses
- Accounts: invoices and receipts in date order for a quarter's bookkeeping.
- Schools: reports or certificates sorted by student surname before handing out.
- Property management: statements grouped by tenant or account number.
- Legal and audit: documents arranged chronologically for a bundle or a review.
- Archives: mixed scans put into reference-number order before filing.
Before you sort
Remove blank pages and duplicates first, and turn sideways pages upright, so every page's text can be read. If the batch was scanned without a text layer, decide whether to run OCR once on the whole file, which also makes it searchable, or let the sorter read pages with OCR as it goes.
Checking a sample
After sorting, open a few pages near the start, middle and end to confirm the keys run in order.
Privacy
Sorting happens in your browser; nothing is uploaded.


&c=%23b45309&k=from-pdf)
