How to Rename a File or Folder on Mac
In this article
Renaming a file or folder on a Mac is a basic but essential task. Whether you're organizing documents, fixing a typo, or giving a project a clearer name, macOS offers several quick ways to do it. This guide walks you through the simplest methods, common mistakes to avoid, and what to do if the rename option isn't working.
What You'll Need
- A Mac running macOS (any recent version, including Ventura, Sonoma, or Sequoia).
- Permission to modify the file or folder. If it's in a shared or protected location, you may need administrator access.
- If the file is open in an app, close it first—macOS may not allow renaming while the file is in use.
Step-by-Step
- Locate the file or folder in the Finder. Use a Finder window (click the Finder icon in the Dock) or the desktop.
- Select the item by clicking it once. It will become highlighted.
- Trigger the rename mode using any of these methods:
- Press the Return (Enter) key on your keyboard. This is the fastest method.
- Click the item's name once, pause, then click the name again. (Don't double-click—that opens the file.)
- Right-click (or Control-click) the item and choose Rename from the context menu.
- Select the item, then go to the menu bar and choose File > Rename.
- Type the new name. The old name will be highlighted; just start typing to replace it. Use the arrow keys to move the cursor if you need to edit part of the name.
- Press Return to confirm the new name. Or click anywhere else on the screen.
- Undo if needed: Immediately after renaming, press Command-Z to revert to the previous name.
Renaming multiple files at once (macOS 10.10 or later):
- Select all the files you want to rename (hold Command and click each one, or drag a selection box).
- Right-click one of the selected files and choose Rename X Items.
- A dialog appears. Choose Replace Text to find and replace text in the names, or Add Text to append text before or after the current names, or Format to create a numbered sequence (e.g., "Vacation 1", "Vacation 2").
- Click Rename.
Common Mistakes
- Double-clicking to rename—this opens the file. Use single click, pause, then click again.
- Forgetting the file extension (like .jpg or .docx). If you change or remove it, the file may not open correctly. macOS usually hides extensions, but if you see one, don't alter it unless you know what you're doing.
- Using characters that macOS doesn't allow: a colon (:) and a forward slash (/) are not allowed in file names. Also avoid names that start with a dot (which hides the file).
- Renaming while the file is open in an app—macOS may give an error or the rename may not stick.
- Not pressing Return—if you click away without pressing Return, the rename is canceled.
Tips
- Use descriptive names that include dates or project names, e.g., "Report_Final_2025-01-15.pdf" instead of "untitled.pdf".
- Keyboard shortcut: Select the file and press Return. This is the fastest way.
- Rename in the Get Info window: Select the file, press Command-I, and edit the name in the "Name & Extension" field. Useful when you also want to change the extension or see file details.
- Use tags instead of renaming for organization—right-click the file and assign a color tag. This keeps the filename clean.
- Batch rename is a huge time-saver for photo collections or downloads. Use the "Format" option to add a sequence number.
Troubleshooting
Rename option is grayed out or not working
- Check if the file is locked. Select the file, press Command-I, and in the Get Info window, uncheck the "Locked" checkbox.
- Check folder permissions. If the folder is read-only or owned by another user, you may not be able to rename items inside it. Open Get Info on the folder and look at the "Sharing & Permissions" section.
- If the file is on a network drive or external disk, make sure it's not disconnected or write-protected.
- Restart the Finder: Hold Option and right-click the Finder icon in the Dock, then choose "Relaunch."
Renaming gives an error "The operation can't be completed"
- This often happens if the file is open in an app. Close the app and try again.
- If the file is in iCloud Drive and not fully downloaded, wait for it to download (look for a cloud icon next to the name).
You accidentally changed the extension
- Rename the file again and restore the correct extension (e.g., .jpg). If macOS asks for confirmation, click "Use .jpg".
- If the file still doesn't open, you may have corrupted the association. Revert the name to the original extension.
Frequently Asked Questions
Can I rename a file while it's open?
Usually not. macOS may allow it in some apps, but it's safer to close the file first. Some apps like TextEdit will let you rename via Save As.
How do I rename a file without using the mouse?
Select the file with arrow keys, then press Return. Type the new name and press Return again.
Can I undo a rename?
Yes, press Command-Z immediately after the rename. If you've done other actions since, you can still undo multiple steps in the Finder's Edit menu.
Why can't I rename a file on my desktop?
Check if the file is locked or if you have permission. Also, if you're using iCloud Desktop & Documents, the file might be syncing—wait a moment and try again.
How do I rename a folder in the Dock?
Folders in the Dock are shortcuts. Right-click the folder icon, choose "Options," then "Show in Finder." Rename the actual folder in Finder.
Can I rename a file with a slash in the name?
No. Slashes (/) and colons (:) are reserved for the file system. Use a hyphen or underscore instead.