How to Batch Rename Files on a Mac (with Preview and Undo)

On this page
Short answer: To batch rename files on a Mac, select them in Finder, Control-click and choose Rename. Pick Replace Text, Add Text or Format (for numbered names), then click Rename. Press ⌘Z straight away if you get it wrong. For regular expressions or several rules at once, use Terminal's
zmvor a dedicated rename tool.
You've got 140 photos called IMG_4012.HEIC and you want them called "Lisbon 001". Or a folder of invoices where every name says "Final" and none of them are. Renaming them one at a time is not an option.
Finder has had a batch rename tool since 2014. It's good for simple jobs and gets awkward fast. Here's how to use it, where it stops, and the options when it isn't enough.
How do I batch rename files in Finder?
Apple's guide to renaming files, folders and disks covers the basics. On macOS 26 Tahoe and later (we tested on 26.5):
- Select the files in Finder. ⌘-click picks individual files, ⇧-click selects a range, ⌘A selects everything.
- Control-click one of them and choose Rename, or choose File › Rename.
- Choose a mode from the pop-up menu under Rename Finder Items (details below).
- Check the Example line at the bottom of the window.
- Click Rename.
What can Finder's Rename window do?
It has three modes, and you can use one per pass.
| Mode | What it does | Example |
|---|---|---|
| Replace Text | Finds plain text in each name and swaps it | "Final" → "v2" |
| Add Text | Adds text before or after each name | "2026 " + Invoice.pdf |
| Format | Rebuilds every name as a base name plus an index, counter or date | Lisbon00001.heic |
Format has three choices: Name and Index, Name and Counter and Name and Date. You type a base name in Custom Format, choose whether the number or date goes before or after it, and set the number to start at. File extensions stay as they are in every mode.
The independent rename tool maker Public Space notes that on macOS 26 and 27 the counter in Name and Counter always pads to five digits, such as Photo00001.jpg, and you can't choose the width.
On macOS 27: MacRumors reports that Apple Intelligence can suggest a name for a single file or folder based on its contents. Apple's own macOS 27 notes don't mention it, and nothing suggests the batch Rename window has changed.
Can I undo a batch rename on a Mac?
Yes, if you're quick. Press ⌘Z, or choose Edit › Undo, right after clicking Rename, and Finder restores every original name in one step. Public Space's guide confirms that ⌘Z undoes the entire batch as long as you do it immediately. If you've moved on and done other things in Finder, the rename may no longer be next in line to undo. Apple's own guide simply advises changing the name back if a rename causes problems.
Where does Finder's batch rename fall short?
- No patterns. Replace Text matches exact text only. There are no wildcards or regular expressions, so "remove everything in brackets" is impossible.
- One rule per pass. You can't replace text, add a prefix and number the files in one go. You run the window three times.
- One example, not a full preview. You see what the first file becomes, not the whole list, so clashes and odd names surface after the fact.
- No metadata. Finder can't read a photo's capture date or a song's tags, so you can't build names from them.
- Fixed numbering. You get the counter width and position Finder chooses.
How do I batch rename files with regular expressions on a Mac?
There are three built-in routes, from easiest to most flexible.
Automator. Automator still ships with macOS 26. Create a Quick Action that receives files in Finder and add the Rename Finder Items action. It adds options Finder's window lacks, such as Change Case and Make Sequential. Save it, and it appears in Finder under Quick Actions when you Control-click. It still has no regular expressions.
Terminal with zmv. The Z shell, the Mac's default shell, includes zmv, which renames with patterns. Always run it with -n first: that prints what would happen without changing anything.
autoload -U zmv
zmv -n 'IMG_(*).jpeg' 'Lisbon-$1.jpg'
When the list looks right, run the same line without -n. We tested both lines on macOS 26.5. There's no undo, so try it on a copy of the folder first.
A rename app. Dedicated tools such as A Better Finder Rename and the rename tools in dual-pane file managers add regex, metadata and multi-step rules. ForkLift's Multi-Rename, for example, supports regular expressions, as of November 2026.
How Sunroom does it
Sunroom Files has a batch rename built for the jobs Finder can't do in one pass. You stack rules: replace, regular expressions, prefix and suffix, numbering, dates and case. A live preview shows the new name of every file before anything changes, and clashes are caught first, so two files can't end up fighting for one name.
Rules can use photo dates as well as numbers. And if the result still isn't right, the whole rename can be undone, with ⌘Z going back through 50 steps.

Sunroom runs on macOS 14 Sonoma or later, on Apple silicon Macs, and is in private beta.
Which batch rename method should I use?
| Method | Regex | Rules per pass | Preview | Undo |
|---|---|---|---|---|
| Finder Rename | No | One | One example | ⌘Z straight after |
| Automator Rename Finder Items | No | Several actions in a row | No | Work on copies to be safe |
zmv in Terminal |
Shell patterns | One command | With -n (dry run) |
None |
| Sunroom Files | Yes | Stacked rules | Every file, live | Yes, up to 50 steps |
Renaming is often step one of a bigger tidy-up. If you're also shrinking photos, see how to batch resize and convert images. For screenshots piling up on the desktop, read how to organise desktop screenshots. More tips live in our Finder & Files guides.
FAQ
How do I rename multiple files at once on a Mac?
Select the files in Finder, Control-click one of them and choose Rename. Pick Replace Text, Add Text or Format, fill in the fields and click Rename.
Can I undo a batch rename in Finder?
Yes, if you do it straight away. Press ⌘Z or choose Edit › Undo right after clicking Rename and Finder restores the old names. Once you have done other things in Finder, the rename may no longer be next to undo.
Does Finder's batch rename support regular expressions?
No. Finder's Replace Text matches plain text only, with no wildcards or regular expressions. Use the zmv command in Terminal or a dedicated rename app for patterns.
How do I number files in order on a Mac?
In Finder's Rename window choose Format, then Name and Counter. Type a base name in Custom Format and a starting number. On macOS 26 the counter pads to five digits, such as Photo00001.jpg.
Fix your Mac the way Apple didn't.
Sunroom adds better Files, Calendar, Mail and Music apps, a live Home screen and Ray, an AI agent that asks before it acts. Join the waitlist for the private beta.



