When Bates numbers come out in the wrong order, a common cause is the order in which the files were fed to the numbering tool. A tool that sorts names as text puts “Exhibit 10” before “Exhibit 2”, while a natural sort reads the digits as numbers and puts 2 first. The fix is to see the order before anything is stamped, and to name files so every sort agrees. BatesBind, a Windows app from Automata Labs, lists every PDF in a folder in natural order with its page count and the exact Bates range it will receive, lets you drag any file into place, and only then writes the numbered copies and the index.
This guide explains the two sorting rules, the naming patterns that break them, and a routine that keeps a production in the order you intended.
See every file’s Bates range before you export, and drag anything that is out of place.
Get it from Microsoft
Why did Exhibit 10 get numbered before Exhibit 2?
Because the files were sorted as text. Text sorting compares names one character at a time, and the character “1” comes before “2”. So “Exhibit 10” wins at the ninth character, before the computer ever sees that 10 is bigger than 2.
Microsoft’s documentation for the Windows function StrCmpLogicalW shows the two behaviors side by side. Treating digits as text (as its StrCmpI comparison does) orders strings like this: 20string, 2string, 3string. Treating “digits in the strings as numerical content” orders them 2string, 3string, 20string. The second behavior is usually called natural sorting.
Here is what that means for a folder of exhibits:
| Text sort | Natural sort |
|---|---|
| Exhibit 1.pdf | Exhibit 1.pdf |
| Exhibit 10.pdf | Exhibit 2.pdf |
| Exhibit 11.pdf | Exhibit 3.pdf |
| Exhibit 2.pdf | Exhibit 10.pdf |
| Exhibit 3.pdf | Exhibit 11.pdf |
If one tool shows you the natural order and another numbers in text order, the stamped set will not match what you reviewed.
Which tools sort which way?
You cannot assume. File Explorer normally lists Exhibit 2 before Exhibit 10, which makes the folder look correct. Other places sort as text: the Windows dir command, for example, sorts “alphabetically by name” when you ask it to order by name, according to Microsoft’s dir documentation. Scripts, upload portals and some PDF tools use their own rules, or keep the order in which files were added.
Microsoft adds a warning in the StrCmpLogicalW documentation that matters for anything you will certify later: the behavior of the function, and therefore its results, “can change from release to release,” and it “should not be used for canonical sorting applications.” In other words, natural sorting is a display convenience. A production sequence should not depend on it.
Which file names cause trouble?
Even with natural sorting, some naming patterns put files where you did not expect:
| Pattern | What happens | Better |
|---|---|---|
| Exhibit 1, Exhibit 2 … Exhibit 10 | Text sort puts 10 after 1 | Exhibit 001, Exhibit 002 … Exhibit 010 |
| Mixed padding: 01, 2, 010 | Different tools disagree on the order | One padding width for the whole set |
| Dates as month-day-year: 11-02-2024, 01-20-2025 | Sorts by month, not by date, so 2025 files land before 2024 | Year-month-day: 2024-11-02, 2025-01-20 |
| Section-style numbers: 1.9, 1.10 | A natural sort reads 10 as ten, so 1.10 comes after 1.9 (right for sections, wrong if you meant decimals) | Decide which you mean and pad: 1.09, 1.10 |
| Email and its attachments named separately | Attachments sort away from the email they came with | A shared prefix: 0007-1 Email, 0007-2 Attachment |
| Leading words that vary: Letter, Email, Invoice | Files group by type instead of by sequence | Put the sequence number first |
Zero-padded sequence numbers at the start of the name are the simplest fix. With “001 Contract.pdf”, “002 Letter.pdf” and “010 Email.pdf”, text sorting and natural sorting give the same order, so every tool agrees.
Natural order by default, drag to change it, and an index that records the order you approved.
Get it from Microsoft
How do you lock in the order with BatesBind?
BatesBind numbers a folder of PDFs and writes an index page, and it is built so the order is visible before anything is written:
- Open the folder. BatesBind lists every PDF in natural order, counts the pages and assigns one continuous Bates range across the set. Subfolders can be included.
- Read the table. Each row shows the file, its page count and the first and last number it will receive. Files it cannot read are listed with the reason and left out, so the numbering stays continuous for the rest.
- Fix the order. Drag a row, or use Move up and Move down, to put any file where it belongs, then read the ranges again.
- Set the label. Choose your prefix, zero-padded digits and start number. Labels go at the bottom right of the visible page or another corner you choose, stay upright on rotated and cropped scans, and never move existing page content.
- Export. Write one bound PDF with the index in front, or a stamped copy of each file plus a separate index PDF. The index lists every file with its page count and its first and last number, and, in the bound PDF, the page where each file begins.
The index is your record of the order you approved. If someone later asks why a document carries a particular number, the index answers it. Originals are never changed: BatesBind writes new files only and refuses to write where an original lives. Our Bates production log page covers the log side in more detail.
What should you check before you send the production?
| Check | Why |
|---|---|
| The first and last file in the index | Confirms the set starts and ends where you planned |
| Any file listed as unreadable | It was left out of the numbering; decide whether it needs a slip sheet |
| Families (emails with attachments) | They should sit together in sequence |
| The last number against the next production | A rolling production starts where this one ended |
| The label format | It should match the order or agreement in your matter |
For a withheld document, our guide to slip sheets in discovery explains how to keep its place in the sequence, and the Bates number format guide covers prefixes and padding.
Frequently asked questions
Why are my PDFs Bates numbered in the wrong order?
The tool numbered them in a different order than the one you reviewed, usually because it sorted the names as text, where 10 comes before 2. Zero-pad your sequence numbers or use a tool that shows the order and ranges before export.
What is natural sort order?
A sort that reads runs of digits as numbers, so 2 comes before 10. Microsoft’s StrCmpLogicalW documentation describes it, and also says its results can change between releases.
Can I change the order in BatesBind after opening a folder?
Yes. Drag a row, or use Move up and Move down, and check the ranges in the table before you export.
Does BatesBind upload my documents?
No. It runs on your PC, does not upload anything, has no account and never changes the originals.
Is this legal advice?
No. The format and order your matter requires come from the order, agreement or rules that apply to it.
Try BatesBind
BatesBind is a one-time purchase in the Microsoft Store with a free trial. Open the folder for your next production, check the order and ranges in the table, and export a test copy before you buy. More detail is on the BatesBind product page.
Number a folder of PDFs in the order you approved, with an index of every range. Local.
Get it from Microsoft
Windows is a trademark of the Microsoft group of companies. BatesBind is not affiliated with Microsoft.
Last updated 20 October 2026. Published by Automata Labs, a software company in Canada.