The fastest way to rename a file

Right-click the file and select Rename from the menu. Type the new name and press Enter. That works on Windows, Mac, and Linux — it is the same across all three.

If you are using a keyboard, you can also select the file and press F2 on Windows or Enter on Mac to jump straight into rename mode without opening a menu. On Linux, the keyboard shortcut depends on your file manager, but right-click always works.

The file keeps its type — a .jpg stays a .jpg, a .pdf stays a .pdf. Changing only the name part does not break anything.

Key Takeaways

  • Right-click any file and select Rename to change its name in one step, then press Enter to confirm.
  • On Windows, press F2 after selecting a file to rename it without opening a menu; on Mac, press Enter instead.
  • Renaming a file does not change what type of file it is — the file extension (.jpg, .pdf, .docx) stays the same unless you deliberately change it.
  • If you rename many files at once, batch rename tools built into Windows and Mac can save time, or you can rename them one by one in a folder view.
  • Spaces, numbers, and most punctuation are safe in filenames, but avoid forward slashes, backslashes, colons, and asterisks, which operating systems reserve for other purposes.

Renaming files in Windows File Explorer

Open File Explorer, find the file you want to rename, right-click it, and click Rename. The filename will highlight and become editable. Type the new name and press Enter.

You can also select the file once and press F2 to enter rename mode without right-clicking. This is faster if you are renaming several files in a row.

Windows keeps the file extension hidden by default — you will see "report" instead of "report.docx". If you need to change the extension itself, you must show file extensions first. Go to the View tab in File Explorer, check the box next to File name extensions, and then you can edit the full filename including the .docx part.

Renaming files on Mac

Open Finder, find the file, and press Enter. The filename becomes editable. Type the new name and press Enter again to confirm.

You can also right-click the file and select Rename from the menu. Both methods work the same way.

If you try to change the file extension on Mac, the system will ask whether you want to keep the old extension or use the new one. Choose based on what you need — if you are just renaming a photo from "vacation.jpg" to "beach.jpg", keep the extension. If you are converting a file type, change it.

Renaming files on Linux

In most Linux file managers (like Nautilus on Ubuntu or Dolphin on Fedora), right-click the file and select Rename. The filename becomes editable. Type the new name and press Enter.

Some Linux file managers also let you press F2 to rename, though this varies by desktop environment. If right-click does not work in your file manager, check the Edit menu for a Rename option.

From the command line, use the mv command: type mv oldname.txt newname.txt and press Enter. This is faster for renaming many files at once if you are comfortable with the terminal.

Renaming multiple files at once

Windows 10 and later include a built-in batch rename tool. Select multiple files in File Explorer (click one, hold Ctrl, and click others), right-click, and select Rename. Windows will rename the first file and add a number in parentheses to each of the others — "photo (1)", "photo (2)", "photo (3)" — based on the name you type.

Mac does not have a built-in batch rename feature in Finder, but you can use the command line or third-party tools. On Linux, the command line is the standard way to rename many files at once using tools like rename or mmv.

If you need more control over batch renaming — for example, to add dates or sequence numbers in a specific pattern — third-party tools like Bulk Rename Utility (Windows) or Advanced Renamer (Windows and Mac) give you more options than the built-in tools.

Characters to avoid in filenames

Most letters, numbers, spaces, hyphens, and underscores are safe. Avoid these characters, which operating systems use for other purposes: forward slash (/), backslash (\), colon (:), asterisk (*), question mark (?), quotation mark ("), and pipe (|).

On Windows, also avoid these reserved names for the entire filename: CON, PRN, AUX, NUL, COM1 through COM9, and LPT1 through LPT9. You can use them as part of a longer name — "myfile_CON.txt" works fine — but "CON.txt" alone will cause problems.

If you use a character that is not allowed, the operating system will show an error message and prevent you from saving the name. Just remove the character and try again.

What happens when you rename a file

Renaming changes only the name you see in your file manager. The file itself stays in the same location, keeps all its contents, and all your programs can still open it the same way.

Shortcuts and links to that file may break if they pointed to the old name, depending on how they were created. If you have a shortcut on your desktop that pointed to "report.docx" and you rename it to "report_final.docx", the shortcut will no longer work. You would need to delete the old shortcut and create a new one.

If you rename a file that is currently open in a program, the program usually keeps working with the file under its new name. Some older programs may get confused, so it is safer to close the file first, rename it, and then open it again.

Frequently Asked Questions

Can I rename a file while it is open?

Yes, most programs will continue working with the file under its new name. However, some older software may not handle this well. To be safe, close the file first, rename it in your file manager, and then open it again.

What if I change the file extension by mistake?

If you renamed "photo.jpg" to "photo.png" by accident, just rename it back to "photo.jpg". The file itself has not changed — only the name. Changing the extension does not convert the file to a different format, it just tells your computer what program to use when you double-click it.

Can I undo a rename?

No, renaming is not reversible through an undo command. If you renamed a file and forgot the old name, you can search your file manager for partial names or check your file manager's history if it keeps one. Otherwise, you will need to rename it again to something you remember.

Why does my file manager show the extension and yours does not?

Windows and Mac hide file extensions by default to keep filenames cleaner. You can turn this on in settings — in Windows, use the View tab in File Explorer; on Mac, open Finder preferences and check Show all filename extensions. Linux file managers usually show extensions by default.

Can I rename a folder the same way as a file?

Yes, the process is identical. Right-click the folder, select Rename, type the new name, and press Enter. Folders do not have extensions, so you only change the folder name itself.