How to batch rename files on a Mac (numbers, dates, regex)
Updated
To rename several files at once in Finder, select them, right-click one, and choose "Rename". You can then use Replace Text, Add Text or Format. Format gives every file a new name with an index, a counter or a date before or after it.
To pad numbers to the width you want, such as 001, insert the date a photo was taken, or stack several rules, use batch rename in Haemil Explorer. Select the files and press F2. Each step you add updates the new names in the table right away, and one ⌘Z undoes the whole rename after you apply it. It is a Pro feature, and you can try it free for the first 14 days.
Finder's built-in Rename
- Select all the files to rename.
- Right-click (Control-click) one of them and choose "Rename".
- In the "Rename Finder Items" window, pick a method and click Rename.
| Finder method | What it does |
|---|---|
| Replace Text | Finds text in the names and replaces it |
| Add Text | Adds text before or after the current name |
| Format | Choose Name and Index, Name and Counter or Name and Date, type the new name under Custom Format, and enter the number to start from |
What Finder cannot do
There is no setting for the width of the number, so you cannot ask for 001, 002, 003.
You use one method at a time. To replace text and add numbers, you rename twice.
It has no regular expressions and no option to put a photo's date taken or the parent folder's name into the name.
Build the rename step by step in Haemil
- Select the files and press F2. "Batch Rename…" in the right-click menu or the ⋯ menu does the same.
- Click "Add Step" to add what you want done. Steps run from top to bottom.
- Check the New Name column. To change a single name by hand, double-click it or press F2.
- Click Apply, or press ⌘S or Enter.
Click a column header to sort, and use ⌥↑ and ⌥↓ to reorder rows. Numbers follow the table order. Save steps you use often with "Save Preset".
Batch rename is a Pro feature, and you can try it free for the first 14 days. Renaming a single file with F2 is free.
The steps you can add
| Step | What it does |
|---|---|
| Replace Text | Replaces text, with optional regular expressions and references such as $1 |
| Add to Start, Add to End | Adds text, the parent folder name, date created, date modified or date taken |
| Remove | Removes the whole name, characters N to M, the last N characters, text in brackets, or digits |
| Number | Adds a number with a start, an increment and a width, optionally restarting per folder |
| Pad Numbers | Pads a number in the name to a fixed width (7 becomes 007) |
| Add to Numbers | Adds to or subtracts from a number in the name |
| Change Case, Extension, Move to Folder | Changes case or extension, or moves the files to another folder |
Guards against mistakes
A new name that is empty, that two files share, or that already exists in the folder shows as an error. Names containing "/" or ":" are errors too.
Characters Windows cannot use, and a trailing dot or space, show as warnings. That helps when you share files with Windows users.
Apply renames every file or none of them, so you never end up with half the files renamed. Swapping two names works without overwriting either file.
After you apply, one ⌘Z puts every name back. If you close the window without applying, only your steps are lost and no file is renamed.
Edit the names in Excel
- Click "Copy Names". The new names are copied one per line.
- Paste them into Excel or a text editor and edit them.
- Copy the edited lines and click "Paste Names". They go in one per line, in table order.
Example: name photos 2026-10-23_trip_001
- Select the photos and press F2.
- Add a "Remove" step and choose "Whole name".
- Add an "Add to Start" step, choose "Date taken" and the YYYY-MM-DD format.
- Add an "Add to End" step and type _trip in the text box.
- Add a "Number" step. Its defaults are After name, separator _ and 3 digits, so leave them.
- Check that the table shows names such as 2026-10-23_trip_001.jpg, then apply.
Files without a date taken use the date created instead. The extension stays as it was.
FAQ
Does it change file extensions?
Steps apply to the name without its extension. Use the Extension step to change extensions.
Can I rename folders in bulk too?
Yes. Folders have no extension, so steps apply to the whole folder name.
Is batch rename free?
Batch rename is a Pro feature, and you can try it free for the first 14 days. Renaming a single file with F2 is free.