Skip to content

Mac file guides

How to batch rename files on a Mac

By · Updated · 3 min read

Short answer

Select the files in Finder, Control-click one and choose Rename. Pick Replace Text to swap a word, Add Text to put something before or after each name, or Format to number them (Name and Index, Counter or Date), then click Rename. It’s built in and free, and ⌘Z undoes it.

How do I rename multiple files at once in Finder?

  1. 1Select the files (⌘-click to pick several, or ⌘A for the whole folder).
  2. 2Control-click one of them and choose Rename.
  3. 3Choose Replace Text, Add Text or Format from the pop-up menu.
  4. 4Fill in the fields and check the example name shown at the bottom.
  5. 5Click Rename.

Changed your mind? Press ⌘Z in Finder straight away.

How do I number files in order, like Photo 1, Photo 2?

  1. 1Sort the folder the way you want the numbers to run (for example by Date Created).
  2. 2Select the files, Control-click › Rename, and choose Format.
  3. 3Choose Name and Index, type the base name (“Photo”), and choose where the number goes.
  4. 4Set the starting number and click Rename.

How do I replace a word in many file names?

  1. 1Select the files, Control-click › Rename, and choose Replace Text.
  2. 2Type the text to remove in Find, and its replacement in Replace with (leave it empty to delete the text).
  3. 3Click Rename.

What should I avoid when renaming files?

  • Changing the extension (.jpg, .pdf): the file may stop opening in its app.
  • Renaming files inside app bundles, Library folders or system folders.
  • Renaming files a project or app links to by name, such as images in a website folder.

Batch renaming with Peekaboo

Peekaboo’s bulk rename uses one pattern with {name}, {n} for a number, {date} for the date each file was created, and {ext}, or find and replace with a Match case option, and shows every new name in a live preview before anything changes. It warns when a name is already taken and asks before changing an extension. Because Peekaboo searches in plain English, you can gather the files first (“screenshots from last week”) wherever they are, then rename them together.

  1. 1Find the files, for example “screenshots from last week”.⌘F
  2. 2Select them and choose Rename from the right-click menu.
  3. 3Type a pattern like “Receipt {date} {n}” and check the preview, then rename.

Questions

Can I undo a batch rename on Mac?

Yes, with ⌘Z in Finder right after renaming. Once you’ve done other things, rename them back by hand or with the same tool.

Can I rename files by date on a Mac?

Finder’s Format option can add a date, and Shortcuts or Automator can build names from creation dates. Some file managers add date tokens to a rename pattern.

Is there a Terminal command to rename many files?

Yes, a for loop with mv can do it, but a mistake renames everything at once with no preview. Finder’s Rename is safer for most people.

Sources

Your privacy choices

With your permission, Google Analytics measures visits to this site using cookies. Privacy policy.