Tutorial2026-11-0810 min read

How to Rename a File on Windows, Mac, Linux, iPhone and Android

To rename a file, select it and press the rename shortcut, type the new name, and press Enter: on Windows the shortcut is F2, on a Mac it is Return, and on most Linux desktops it is F2. On an iPhone or iPad, touch and hold the file in the Files app and tap Rename; on Android, open the file's three-dot menu in Files by Google and tap Rename.

That covers most cases. The rest of this guide walks through each device step by step, then covers the things that usually go wrong: renaming a Word document that is still open, characters a file name is not allowed to contain, permission errors, and the warning you get when you change a file extension.

How to Rename a File on Windows 11

File Explorer gives you three ways to start a rename. They all end the same way: the name becomes an editable text box with everything except the extension selected.

Method 1: The F2 key

  1. Open File Explorer (Windows + E) and go to the file.
  2. Click the file once to select it.
  3. Press F2. The name turns into a text box.
  4. Type the new name and press Enter.

Press Esc instead of Enter to cancel. On some laptops the top row controls brightness and volume by default, so you may need to press Fn + F2.

Method 2: Right-click

  1. Right-click the file.
  2. In the Windows 11 context menu, click the Rename icon in the row of icons at the top or bottom of the menu. If you are used to the old text menu, choose Show more options, then Rename.
  3. Type the new name and press Enter.

Method 3: The command bar

Select the file, then click the Rename icon in the command bar at the top of File Explorer.

Renaming several files one after another

While a name is in edit mode, press Tab instead of Enter. Windows saves the name you typed and moves straight into editing the next file in the folder. Shift + Tab goes back to the previous one. This is the fastest way to give a dozen files different names by hand.

Undoing a rename on Windows

Press Ctrl + Z in File Explorer right after renaming to put the old name back. It works for the last few file operations in that session, so do it before you move on to other work.

Renaming a folder on Windows

Folders rename exactly like files: select the folder and press F2, or right-click and choose Rename. You cannot rename a folder while a file inside it is open in another program, or while a Command Prompt or terminal window is sitting in that folder. If you need to rename many folders, see how to bulk rename folders on Windows.

For more Windows-specific detail, including Command Prompt and PowerShell, see how to change file names on Windows.

How to Rename a File on a Mac

Finder treats the Return key as "rename", which surprises many people coming from Windows (where Enter opens the file).

Method 1: The Return key

  1. Open Finder and click the file once to select it.
  2. Press Return. The name becomes editable, with the part before the extension highlighted.
  3. Type the new name and press Return again.

Press Esc to cancel.

Method 2: Click the name

Select the file, wait a moment, then click directly on its name once more. The name becomes editable. This is easy to trigger by accident, which is why some people think their Mac "randomly" asks them to rename things.

Method 3: Right-click (Control-click)

Right-click or Control-click the file and choose Rename. If you select several files first, the same menu item opens Finder's batch rename window instead, covered below.

Method 4: Get Info

  1. Select the file and press Command + I (or right-click and choose Get Info).
  2. Under Name & Extension, edit the name.
  3. Close the window to save it.

Get Info is the most reliable way to change the extension on a Mac, because the field always shows the full name, including the extension, even when Finder hides extensions in its file list.

How to rename a folder on Mac

Select the folder in Finder and press Return, type the new name, and press Return again. Right-click > Rename and Get Info work for folders too. Two exceptions: Finder will not let you rename system folders such as Applications or the folders in your home directory (Desktop, Documents, Downloads), and an item marked Locked in Get Info needs that box unchecked first.

Undoing a rename on Mac

Press Command + Z in Finder immediately after renaming to restore the old name.

How to Rename a File on Linux

In the GNOME Files app (Nautilus, the default file manager on Ubuntu and Fedora Workstation), select a file and press F2, or right-click and choose Rename. Type the new name and press Enter. KDE's Dolphin and Xfce's Thunar also use F2.

In a terminal, rename with mv:

mv old-name.txt new-name.txt

Put quotes around names with spaces: mv "my report.pdf" "final report.pdf". Add -i to be asked before overwriting an existing file. There is much more to it, including the two different rename commands and bulk loops, in our guide on how to rename files in Linux.

How to Rename a File on iPhone or iPad

On iOS and iPadOS, files you can rename live in the Files app (On My iPhone, iCloud Drive, or a connected service).

  1. Open the Files app and browse to the file.
  2. Touch and hold the file until a menu appears.
  3. Tap Rename.
  4. Type the new name and tap Done on the keyboard.

Folders rename the same way. Photos in the Photos app do not have editable file names in the usual sense; to give a photo a real file name, save it to Files first. Our guide on how to rename photos on iPhone covers that workaround.

How to Rename a File on Android

Android menus differ by manufacturer, but Files by Google (preinstalled on many phones and free on the Play Store) works like this:

  1. Open Files by Google and tap Browse.
  2. Find the file, then tap the three-dot menu next to it. Alternatively, touch and hold the file to select it, then tap the three-dot menu at the top of the screen.
  3. Tap Rename.
  4. Type the new name and tap OK.

Samsung's My Files app is similar: touch and hold the file, then look for Rename in the bottom bar or under More. For more on phones and tablets, see renaming files on Android.

How to Rename a Word Document

Renaming a Word doc is the same as renaming any other file, with one catch: you cannot rename it in File Explorer or Finder while it is open in Word. Windows shows "The action can't be completed because the file is open in Microsoft Word."

The simple fix:

  1. Save your work and close the document in Word.
  2. Rename the .docx file in File Explorer (F2) or Finder (Return).
  3. Open it again.

If you would rather not leave Word:

  • Files on OneDrive or SharePoint: click the file name in Word's title bar and edit the File Name field. Word for the web works the same way: click the document name at the top of the page.
  • Local files: use File > Save As (or Save a Copy) and give it the new name, then delete the old copy. This creates a new file rather than renaming the original, so make sure you delete the right one.

The same rules apply to Excel and PowerPoint files. On a Mac, document-based apps such as Pages and TextEdit let you click the document title in the window's title bar and rename it there without closing it.

One more thing to watch: Word's recent files list and any shortcuts or links to the document still point at the old name after you rename it, so they will show as missing until you open the file again from its new location.

Rename Keyboard Shortcuts at a Glance

  • Windows 11: F2 to rename the selected file, Tab / Shift + Tab to jump to the next or previous file, Esc to cancel, Ctrl + Z to undo.
  • macOS: Return to rename the selected file, Esc to cancel, Command + Z to undo, Command + I to open Get Info.
  • Linux (GNOME Files, Dolphin, Thunar): F2 to rename, Esc to cancel. In GNOME Files, Ctrl + Z undoes the last rename.
  • iPhone, iPad, Android: no shortcut; touch and hold the file, then choose Rename.

How to Rename Many Files at Once

Renaming one file at a time is fine for a handful. For dozens or hundreds, use a batch method:

  • Windows: select several files, press F2, type one name, and press Enter. Windows names them "name (1)", "name (2)" and so on. For anything more flexible, use PowerShell or a dedicated tool.
  • Mac: select several files, right-click, and choose Rename. Finder lets you replace text, add text, or apply a name with a counter.
  • Linux: select several files in GNOME Files and press F2 to open its batch rename dialog, or use a shell loop.

Our full guide on how to rename multiple files at once covers each of these in detail. All of them rename by pattern, though: they can number files or swap text, but they cannot tell you what is inside a file. If your files are named IMG_4821.jpg or scan0003.pdf and you want names that describe the contents, File Renamer AI is a web app: upload your photos, PDFs or documents, and it reads each one, suggests a descriptive name, and lets you review the names before downloading the renamed files as a ZIP.

Rules for Valid File Names

Each operating system blocks a few characters and names. If a rename fails right away, an invalid character is the usual reason.

Windows

  • These characters are not allowed: \ / : * ? " < > |
  • These names are reserved, with or without an extension: CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9. You cannot create "con.txt", for example.
  • A name cannot end with a space or a period; File Explorer quietly removes them.
  • Names are case-insensitive: "Report.docx" and "report.docx" are the same file.
  • Each name can be up to 255 characters, but by default the full path is limited to 260 characters, which deep folder structures can hit.

Mac

  • Finder does not allow a colon (:) in a file name. A slash typed in Finder is allowed and displays as a slash, but Terminal shows it as a colon, so avoid both if files will move between systems.
  • Finder will not let you start a name with a period, because names starting with "." are reserved for hidden system files.
  • By default the Mac file system is case-insensitive but case-preserving, like Windows.

Linux

  • Only the forward slash (/) and the null character are forbidden; almost anything else is technically allowed.
  • Names are case-sensitive: "Report.pdf" and "report.pdf" are two different files.
  • Names are limited to 255 bytes on common file systems like ext4, which means fewer than 255 characters if you use accented letters or non-Latin scripts.

Names that work everywhere

If a file will be shared, emailed, or uploaded, stick to letters, numbers, hyphens, underscores, and a single period before the extension. Our file naming conventions guide has more on choosing names you can find later.

Troubleshooting: Why Can't I Rename a File?

"The action can't be completed because the file is open in another program"

Windows will not rename a file another program is using. Close the file in that program, then try again. If you cannot tell which program has it open, closing apps one at a time usually finds it; preview panes in File Explorer, sync clients like OneDrive or Dropbox, and media players are common culprits. Restarting the computer clears every lock if nothing else works. On a Mac, Finder usually lets you rename files that are open, and many apps follow the rename, but some will lose track of the file until you reopen it.

"You need permission to perform this action"

The file or folder belongs to another user or to the system, or it is in a protected location such as Program Files or the Windows folder. Avoid renaming files there unless you know what they do: programs depend on those names. For your own files that show this error (for example, files copied from an old drive), right-click the file, choose Properties > Security, and check whether your account has Modify permission. On a Mac, check Sharing & Permissions at the bottom of Get Info, and make sure Locked is unchecked.

"If you change a file name extension, the file might become unusable"

Windows shows this when your new name has a different extension (the part after the last period, like .docx or .jpg). Changing the extension does not convert the file: renaming photo.png to photo.jpg leaves it a PNG with a misleading name. Click No unless you are fixing an extension you know is wrong. Macs show a similar prompt that asks whether to keep the old extension or use the new one. Our guide to changing a file extension explains when it is safe and how to convert files properly.

I can't see the extension, so I can't change it

Windows hides extensions by default. In File Explorer, click View > Show > File name extensions. On a Mac, open Finder > Settings > Advanced and turn on Show all filename extensions, or edit the name in Get Info.

"There is already a file with the same name in this location"

Two files in the same folder cannot share a name. Choose a different name, or rename or move the existing file first.

The Rename option is greyed out or missing

You may be in a read-only location: a CD or DVD, a network share you can only read, a ZIP file you are browsing without extracting, or a cloud folder that is still syncing. Copy the file to a normal folder, like Documents, and rename it there.

Frequently Asked Questions

What is the shortcut key for rename?

On Windows the rename shortcut is F2: select a file or folder in File Explorer and press F2. On a Mac, select the item in Finder and press Return. On Linux desktops such as GNOME, KDE and Xfce, the shortcut is F2. Phones and tablets have no rename shortcut; you touch and hold the file and choose Rename.

How do I rename a file without the mouse?

On Windows, use the arrow keys to select the file in File Explorer, press F2, type the new name and press Enter; press Tab instead of Enter to move straight on to renaming the next file. On a Mac, use the arrow keys in Finder, press Return, type, and press Return again.

Why can't I rename a file on Windows?

The most common reasons are that the file is open in another program, you do not have permission to change it, or the new name contains a character Windows does not allow, such as a colon, question mark, asterisk or quotation mark. Close the program using the file, check the name for invalid characters, and make sure the file is not in a read-only or protected location.

How do I rename a folder on Mac?

Click the folder once in Finder to select it, press Return, type the new name, and press Return again. You can also right-click the folder and choose Rename, or use Get Info (Command + I) and edit the Name & Extension field. System folders like Applications and your Desktop and Documents folders cannot be renamed.

How do I rename a Word document that is open?

Close the document in Word, rename the file in File Explorer or Finder, and reopen it. If the document is stored on OneDrive or SharePoint, you can instead click the file name in Word's title bar and change it there without closing the file.

Does renaming a file change its contents?

No. Renaming only changes the name the file system shows; the data inside is untouched. The one exception is perception: changing the extension can make the operating system open the file with the wrong app, but the contents stay the same and you can rename it back.

Can I undo a rename?

Yes, if you act right away. Press Ctrl + Z in File Explorer on Windows or Command + Z in Finder on a Mac to restore the previous name. If too much has happened since, simply rename the file back to its old name by hand.

Ready to organize your files?

Try AI renaming right away. No sign-up needed until you download.

Try It Free