Renaming many files at once on a Mac

To batch rename files on a Mac, select the files in Finder, Control-click one of them, and choose Rename. A window called Rename Finder Items opens with three modes: Replace Text, Add Text, and Format. Pick one, check the example name at the bottom of the window, and click Rename. Nothing needs to be installed, and Edit > Undo in Finder reverses the whole batch if the result is wrong.

That covers most everyday jobs. It stops being enough when the new name has to come from inside the file (a photo's capture date, a song's artist), when only some files should change, or when the same rename has to happen every week. This guide walks through each Finder mode with the exact labels on screen, then the Terminal route, then the dedicated apps, with what each one costs as of October 9, 2026.

The Finder method, step by step

Apple documents this in the Mac User Guide. The steps below follow the same labels.

  1. Open the folder in Finder and select the files. Click the first, then Shift-click the last for a range, or Command-click to pick individual files.
  2. Control-click any one of the selected files.
  3. Choose Rename from the shortcut menu.
  4. In the Rename Finder Items window, open the pop-up menu at the top left and choose Replace Text, Add Text, or Format.
  5. Fill in the fields. The line starting with "Example:" at the bottom shows what the first file will be called.
  6. Click Rename.

Two habits prevent most mistakes. First, sort the folder the way the numbering should run before selecting anything, because Format numbers files in the order Finder lists them. Sort by Date Created for photos, by Name for scans that already carry a sequence. Second, glance at the Example line after every change to a field. It is the only preview Finder offers.

The rename applies to the full name but protects the extension. A file called report.pdf stays a PDF whatever text is added or replaced. Apple's guide also warns against renaming app folders, items that came with the system, and the home folder, so keep batches inside your own document folders.

Replace Text, Add Text, and Format compared

Each mode solves a different problem, and choosing the wrong one is the usual reason a batch comes out strangely.

Replace Text finds a string and swaps it. Typing ProjectX_ in Find and leaving "Replace with" empty strips a prefix from every name. Typing draft and final changes the word wherever it appears. It matches every occurrence in each name, so a search for 1 also changes the 1 in 2021. Use a longer, more specific string to avoid that.

Add Text puts the same text before or after each current name. Adding 2026-10 before the name dates a month of invoices without touching the rest. It is the safest mode, since the original name survives inside the new one.

Format throws away the old name and builds a new one from a pattern. Choose Name and Index, Name and Counter, or Name and Date, type a base name in Custom Format, and set the starting number. The result is Trip 1, Trip 2, and so on. Counter pads with zeros (Trip 00001), which keeps the order correct when a list is sorted as text. Choose it whenever a batch could pass nine or ninety-nine files.

Mode Keeps the old name Typical use Risk
Replace Text Yes, partly Remove a prefix, fix a typo across files Matches more than intended
Add Text Yes, fully Add a date or client code Very low
Format No Sequence camera files, exports Old names are gone

If Format is the right mode but the old names carry information, run Add Text first to put that information somewhere safe, or copy the folder before starting.

When a batch goes wrong

Finder keeps the rename as one action. Choose Edit > Undo Rename (Command-Z) straight after, and every file goes back to its previous name. This only works while Finder still has the action in its history, so undo before moving, copying, or renaming anything else.

A few problems are not fixed by undo, because they are not errors in the batch itself:

  • Names that look right but sort wrong. Photo 10 comes before Photo 2 in some apps and on some file servers that sort strictly as text. Finder sorts numbers naturally, which hides the problem until the files land elsewhere. Format with Counter avoids this.
  • Duplicates. Finder will not overwrite one file with another of the same name. After a Replace Text run that could produce identical names, check the folder for any file that kept its old name or for an alert about a name already in use.
  • Files open in another app. An app with the file open may keep showing the old name, and some apps lose track of the document. Close files before renaming them in bulk.
  • Cloud folders. In iCloud Drive or a synced folder, a large batch triggers a large sync. Let it finish before renaming the same folder again from another Mac.

For any batch over a few hundred files, duplicate the folder first (Command-D), rename the copy, check it, and only then delete the original. It costs a minute and makes every other risk irrelevant.

Batch rename in Terminal with zmv

The default shell on current macOS is zsh, and zsh ships with a rename function called zmv. It does what Finder cannot: rename by pattern, reorder parts of a name, and show a dry run first.

Open Terminal in the folder (Control-click the folder in Finder's path bar and choose Open in Terminal), then load the function once per session:

autoload -U zmv

A dry run prints every planned change without touching anything. The -n flag is what makes it a dry run:

zmv -n '(*).jpeg' '$1.jpg'

When the list looks right, run the same command without -n. A few patterns cover most needs:

zmv '(*)_draft.(*)' '$1_final.$2'          # swap a word before the extension
zmv '(IMG_)(*)' 'Trip-$2'                  # replace a camera prefix
zmv '(*) (*)' '$1-$2'                      # replace one space with a hyphen

The parentheses capture parts of the old name, and $1, $2 put them back in the new one. That is the feature Finder lacks: moving pieces of a name around, not only adding or removing text.

Terminal has no undo. A dry run is the protection, so make -n a habit, and keep the duplicate-folder habit from the previous section. If a pattern matches nothing, zmv says so and changes nothing, which is safer than a hand-written for loop with mv, where a mistake can overwrite files.

Renaming from file contents and metadata

Some names cannot come from the old name at all. A photo should be named after the date it was taken, a song after its artist and title, a scanned invoice after the vendor and date printed on it.

Finder's Format mode can add a date, but it uses the date the rename runs, not the date stored in the file. For capture dates, artists, or GPS location, a dedicated renamer reads the metadata. For text inside documents, such as an invoice number, either a renamer that reads content with an AI model or an AI agent running in Terminal can propose names. Both need a review step, since a model can misread a scan.

The Shortcuts app sits between the two. It has a Rename File action and can read some file details, such as creation dates. A shortcut built once can run from the Finder's Quick Actions menu on any selection. It suits a repeated rename with simple rules where opening Terminal feels like too much.

A minimal version takes a few minutes to build. Create a new shortcut, open its details, and turn on the option to use it as a Quick Action in Finder, so it receives the selected files as input. Add a Repeat with Each action so every file is handled on its own. Inside the loop, add Get Details of Files to read the Creation Date, Format Date to turn it into a form like 2026-10-09, and Rename File to set the new name from that date and the original name. Save it, then select a few test files in Finder, Control-click, and run it from Quick Actions.

Test it on copies first. Shortcuts shows no preview of the new names before it runs, and it has no undo of its own, so the duplicate-folder habit matters even more here than in Finder. Once it works, the same shortcut can be run on any folder in two clicks, which is often all a weekly routine needs.

Dedicated rename apps and what they cost

When the job repeats or needs metadata, a dedicated app pays for itself in saved time. Figures were read from each vendor's site on October 9, 2026.

App Price Requirements Notable for
NameChanger Free (donations accepted) OS X 10.13 or later Case changes, hiding extensions, image browser
Advanced Renamer Free to try; paid license for professional use Windows and macOS 13 rename methods, EXIF and ID3 data, undo of a whole batch
ForkLift 4 From $19.95 (personal) macOS 14.6 File manager with saved Multi Rename presets
Renamer Paid, also in Setapp macOS 15 or later Live preview, regular expressions, undo with file backup

Sources: NameChanger, Advanced Renamer, ForkLift store, Renamer.

Advanced Renamer's buy page states that the license key does not expire and covers versions 3.xx and 4.xx. ForkLift's personal license is described as lifetime with one year of free updates. These terms matter more than the sticker price if the tool will be in use for years.

For most people the order of escalation is: Finder first, zmv or Shortcuts when the pattern is beyond Finder, and a dedicated app when metadata or a weekly routine is involved.

Keeping a rename you repeat one click away

The common trap with batch renaming is not the first run. It is the fifth, when the zmv pattern from last month has been forgotten and the Finder fields have to be filled in from memory again.

Two ways keep a repeated rename close. One is a shortcut in the Shortcuts app, installed as a Quick Action. The other is to keep the working command where the files are. A file manager with a built-in terminal does this naturally: the terminal opens already in the selected folder, so a saved zmv line runs without a cd, and the file list beside it shows the new names as soon as they change. Some of these apps also let you register a command you type often as a right-click menu item, which turns a tested rename pattern into a menu choice. The features page lists what such a setup includes, including renaming in place with the Return key and adding your own actions. Using it on the Mac costs nothing, as the pricing page shows.

The same applies with an AI agent in that terminal: describe the rename ("prefix every PDF in this folder with the date in its first line"), read the commands it proposes, and confirm before they run.

What to change first

Try the next rename in Finder's Rename Finder Items window with Format and Counter, and duplicate the folder before you start. If the rename needs parts of the old name moved around, learn zmv -n once, then keep the command next to the folder, for example in Atriens, so the second run takes seconds.

Frequently asked questions

How do I undo a batch rename on a Mac?

Right after the rename, choose Edit > Undo Rename in Finder or press Command-Z. All files return to their previous names in one step. Undo must happen before other Finder actions replace it in the history. Renames done in Terminal cannot be undone this way.

Can Finder add numbers with leading zeros?

Yes. In the Rename Finder Items window, choose Format, then Name and Counter. Counter pads numbers with zeros, so files sort correctly as text. Name and Index uses plain numbers, which can sort out of order in apps and servers that compare names as text.

Will batch renaming change the file extension?

Not in Finder. Replace Text, Add Text, and Format all leave the extension untouched, so a JPEG stays a JPEG. In Terminal, zmv changes exactly what the pattern says, so a pattern like '(*).jpeg' '$1.jpg' deliberately changes the extension.

Can I rename photos by the date they were taken?

Not with Finder alone. Its Format option inserts the current date, not the capture date stored in the photo. Use a renamer that reads EXIF data, such as Advanced Renamer, or a Shortcuts workflow that reads the image's date and passes it to the Rename File action.

Back to all posts