Merged PDF Pages Come Out in the Wrong Order
Why merged PDFs end up shuffled — filename sorting puts img10 before img2, file managers disagree on order, and some tools resequence by timestamp. How to guarantee the order you meant.
You selected ten pages, merged them, and page 3 is now page 7. Nothing is corrupted — the pages arrived in an order you didn’t intend.
There are only a few mechanisms that cause this, and each has a specific fix.
1. Filename sorting is lexicographic, not numeric
The most common cause, by a wide margin.
Computers sort filenames character by character, not by the number you intended:
img1.jpg
img10.jpg
img2.jpg
Read as text, img10 comes after img1 and before img2, because 1 < 2. So a scan saved as img1 … img10 merges in this order: 1, 10, 2, 3, 4, 5, 6, 7, 8, 9.
Fix: zero-pad the numbers so every name has the same width.
img01.jpg img02.jpg … img10.jpg
Now the sort is numeric because the text comparison happens to match the number order. img09 < img10 < img11.
If renaming forty files by hand isn’t appealing, most file managers have a batch-rename with a numbered pattern. Or the tool can sort for you — ours reorders after you’ve selected the files.
2. The tool never kept your selection order
Worth knowing: when you pick multiple files in a file dialog, the OS may not report them in the order you clicked. Some systems return them alphabetically, some in directory order, some in whatever order the filesystem hands them over.
So even if you carefully clicked in the right order, the tool may have received a different list.
Fix: check whether the merge tool shows a list you can drag to reorder. If it shows thumbnails in a fixed sequence with no way to change it, the order was decided before you touched it.
3. File timestamps vs filenames
Some tools sort by modification time instead of name. That’s usually what you want for photos taken in sequence — but it breaks in two situations:
- Files copied or downloaded get a new modified time, so the sequence is destroyed
- Files edited later (even opened and resaved) jump to the end
If your pages came out ordered by when the files were copied rather than when they were scanned, this is why.
Fix: set the tool’s sort mode explicitly if it offers one, or rename into a sequence you control.
4. Mixed sources
The classic real-world case: three pages scanned as scan001.pdf, four photographed as IMG_4821.jpg, two exported as page_9.png.
There is no sensible automatic order across those three naming schemes. Any tool will produce something arbitrary.
Fix: decide the order yourself before merging. Two practical approaches:
- Rename everything into one sequence (
p01,p02, …) — boring, always works - Merge in batches, in order, then merge the results — slower but you keep control at each step
5. Duplicate or near-duplicate names
Two folders both containing page1.jpg. Merged from a multi-select, the tool has no way to distinguish them and may interleave.
Fix: include the folder or date in the name.
How to verify before you send it
Don’t trust the thumbnail grid — open the merged file and check the pages in a reader.
- Look at the page count first. If it’s lower than expected, files were deduplicated or rejected, not just reordered.
- Check the first and last page, which catch reverse order and dropped files.
- Scroll through at speed looking for a discontinuity in the content. Page numbers printed on the document itself are the fastest way to spot a swap.
If the original pages are numbered (invoices, contracts, forms), the merged file should read 1, 2, 3 … with no gaps.
A related trap: page ranges
If you’re not merging whole files but extracting ranges, the same off-by-one appears in a different form: does “pages 3–5” mean three pages or two?
For range syntax specifically, see split PDF page ranges — it accepts both 3-5 and comma lists, and shows a preview before writing.
Merge with drag-to-reorder: merge PDFs. Files are combined in your browser and never uploaded.
Related: why a PDF gets huge after merging, why your PDF watermark disappears after saving