How to rename files on a Mac

Rename any file or folder on a Mac in seconds with Finder, rename dozens at once with Batch Rename, change file extensions, and fix a file that won't rename.

How-toRename files

Renaming a file on a Mac doesn't have a big obvious button, which is why so many people search for it. It's quick once you know the key: on a Mac, Return renames, it doesn't open. Here's how to rename one file, a whole batch, file extensions and folders, and what to do when Finder refuses.

Rename one file or folder

This works in Finder and on the Desktop, for files and folders alike.

  1. Click the file once to select it.
  2. Press Return. The name turns into an editable box with everything except the extension selected.
  3. Type the new name.
  4. Press Return to save it, or Esc to cancel.

Prefer the mouse? There are three other ways to get the same editable box:

  • Right-click the file and choose Rename.
  • Select the file and choose File › Rename from the menu bar.
  • Click the file to select it, wait a second, then click its name once more.

Opening a file is ⌘O or a double-click, so Return is free for renaming. Coming from Windows, where F2 renames and Enter opens, this is the one habit to swap.

Rename many files at once

Finder has a batch rename tool built in. It can replace part of every name, add text to every name, or give the whole set a fresh name with a number.

  1. In Finder, select the files. Click the first, then ⇧-click the last, or hold ⌘ to pick them one by one.
  2. Right-click any of them and choose Rename (it says Rename 12 Items… or similar).
  3. Choose what to do from the first menu:
    • Replace Text swaps one bit of text for another in every name, like IMG_ → Paris_.
    • Add Text puts the same words before or after every name.
    • Format gives every file a new name plus a counter, index or date, like Invoice 1, Invoice 2.
  4. Check the Example at the bottom, then click Rename.

Finder's batch rename can only use one pattern for the whole set. If every file needs its own name, like a folder of screenshots that are all different, see how to rename many screenshots at once for the options.

Change a file extension

By default, Finder hides extensions like .png or .pdf for many files. To see and change them:

  1. In Finder, choose Finder › Settings › Advanced.
  2. Tick Show all filename extensions.
  3. Rename the file as usual and edit the part after the dot.
  4. When Finder asks, click Use .xxx to confirm.

Undo a rename

Renamed the wrong file? Press ⌘Z in Finder straight away, or choose Edit › Undo Rename. This also undoes a batch rename in one step.

Rename a file from an app

In many Mac apps, like Pages, Preview, TextEdit and Keynote, you can rename the open document without going to Finder. Click the file name in the title bar at the top of the window, type a new name and press Return. The file is renamed wherever it's saved.

Rename with Terminal

If you're comfortable with the command line, the mv command renames a file:

mv "old name.png" "new name.png"

Put names with spaces in quotes. Run it from the folder that has the file, or use full paths. Be careful: if a file with the new name already exists, mv replaces it without asking.

Automate renaming

For renames you repeat often, the Shortcuts app has a Rename File action, and you can add a shortcut to Finder's Quick Actions menu. Automator, the older automation app, has a Rename Finder Items action that works the same way.

When a file won't rename

  • It's locked. Select it, press ⌘I and untick Locked.
  • It's open in another app. Close the document or quit the app, then try again.
  • You don't have permission. Files in system folders or another user's folders may be read-only. Press ⌘I and check Sharing & Permissions at the bottom.
  • The name has a colon. Finder doesn't allow : in file names. Use a dash instead.
  • Two files would have the same name. A folder can't hold two files with the same name and extension, so add something to make it unique.

Make files easier to find later

Good names do most of the work in search. Spotlight and Finder both search file names, so “Q3 Invoice Acme” is found in a second while “Scan 14.pdf” isn't. For screenshots in particular, see how to find an old screenshot fast, and to stop them landing on your Desktop, change where screenshots save.

Frequently asked questions

How do I rename a file on a Mac?

Click the file once in Finder or on the Desktop, press Return, type the new name and press Return again.

How do I rename multiple files at once on a Mac?

Select the files in Finder, right-click one of them and choose Rename. Pick Replace Text, Add Text or Format, check the example at the bottom and click Rename.

How do I change a file extension on a Mac?

Turn on Finder › Settings › Advanced › Show all filename extensions, then rename the file and change the part after the dot. Finder asks you to confirm; click Use .xxx. Changing the extension doesn't convert the file.

How do I undo a rename on a Mac?

Press ⌘Z in Finder right after renaming, or choose Edit › Undo Rename.

Why can't I rename a file on my Mac?

The file may be locked, open in another app, or in a folder you don't have permission to change. Select it, press ⌘I and untick Locked, quit the app using it, then try again.

Keep reading

All posts →