← Notes

Adding sequential numbers to a folder of files

Numbering files is trivial until you need them to sort correctly, start at something other than one, or follow the order you actually want rather than alphabetical order.

You have forty images that need to be 01 through 40, or a set of documents that must be delivered in a specific order. Finder does this, and there are three ways it will produce a result you did not want.

The built-in method

Select the files, right-click, Rename N Items…, choose Format from the dropdown.

Set a base name, choose Index (a simple counter) or Counter (padded), pick whether the number goes before or after the name, and set a starting number. Finder renames everything in one go.

It works. Now the three ways it goes wrong.

Problem one: sorting order

Finder numbers files in the order they are currently sorted in the window. Not the order you selected them, not the order they were created — the current sort.

If the window is sorted by Name and you want chronological order, you get alphabetical numbering. If it is sorted by Date Added and you wanted Date Created, those are different things.

Sort the window the way you want the numbering before you start. This is the single most common cause of "the numbers are in the wrong order".

For an arbitrary order that matches nothing — a delivery sequence you decided on — Finder cannot help. There is no way to say "this one is 1, this one is 2" other than renaming individually.

Problem two: zero padding

1, 2, 3 … 10, 11 sorts as 1, 10, 11, 2, 3. Almost every system sorts filenames as text, and text sorting puts 10 before 2.

The fix is zero padding: 01, 02, 03 … 10, 11 sorts correctly. For more than 99 files, use three digits.

Finder's Counter option pads; Index does not. Choosing the wrong one produces a folder that looks fine in Finder — which sorts numerically when it can — and shuffles itself the moment it is uploaded, zipped or opened on another system.

Decide the padding by the final count, not the current one. A set that grows from 90 to 110 files later will need renumbering if you padded to two digits.

Problem three: numbering from something other than one

Adding a second batch to an existing numbered set means starting at 41, not 1. Finder lets you set a start number, so this works — as long as you remember, and as long as no gaps exist.

Gaps are the harder case. Delete file 17 from a numbered set and you have a hole. Renumbering to close it means every subsequent file changes name, which breaks any reference to them. Usually the right answer is to leave the gap: numbering is an ordering device, not an inventory.

A format that holds up

project-name_001_descriptive-bit.jpg
  • Prefix so the files group together and are identifiable out of context.
  • Zero-padded number for correct sorting.
  • Optional descriptive suffix so a human can find one without opening it.
  • Separators that survive the web — hyphens and underscores, not spaces.

Numbers at the end (photo-01, photo-02) sort the same way, and are better when the descriptive part matters more than the sequence.

Before you run it

Take a copy. Numbering is not reversible by memory — once the original names are gone, reconstructing which file was which is guesswork.

Test on ten files. Check the padding and the order.

Watch for collisions. If a file in the folder is already called project_001.jpg, a rename that produces the same name has to resolve the conflict somehow, and silent resolution is how files get lost.

Doing this with RenameDeck

RenameDeck shows the complete result list before anything is renamed. For numbering specifically that means you see the sequence and the padding and the order, and catch the alphabetical-instead-of-chronological problem before it happens rather than after.

Numbering is one rule among several you can stack — combine it with a date drawn from the file's own metadata, a case change and a template, then save the whole thing as a recipe. The next batch is one click, starting from whatever number you specify.

It detects invalid names and collisions and never overwrites an existing file, which covers the third risk above. For an arbitrary order that no sort produces, you can import a prepared list or CSV and rename from that — which is the answer to "this one is 1, this one is 2" that Finder has no version of.

Journaled transactions mean an eligible batch can be undone properly. The app is sandboxed with no network entitlement, so nothing about your files leaves the Mac. Requires macOS 14 or later.

Keep reading