See file extensions when renaming files on Mac
You rename Report to Report-final, double-click it, and nothing opens the way it should — because the extension you couldn't see got mangled in the edit. When Finder hides extensions, renaming is guesswork: you're editing a name whose most important part is invisible. Turn extensions on first, and every rename shows you exactly what you're keeping. Open Finder → Settings → Advanced and switch on Show all filename extensions.
Why hidden extensions make renaming risky
With extensions hidden, Finder still stores the suffix — it just doesn't display it. So when you rename a file, macOS quietly re-attaches whatever extension it thinks the file has. That's fine until the two disagree. Paste a name that already contains a dot, batch-edit a folder of mixed types, or drag a file through an app that strips the suffix, and you can end up with Report.docx.docx, a document that opens in the wrong app, or a file the Mac no longer recognises at all.
Showing the extension removes the guesswork. When you press Return to rename, macOS conveniently pre-selects only the base name and leaves the suffix untouched — but you can now see that boundary, so if you do need to change .txt to .md or .jpeg to .jpg, you're doing it deliberately instead of by accident.
Turn on extensions before you rename
- Open any Finder window, then press Command+Comma to open Finder → Settings.
- Click the Advanced tab.
- Turn on Show all filename extensions.
Every file in every folder now shows its full name, suffix included, on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia alike. If you live in the Terminal, the same preference is one command — with its undo right beside it:
# Show extensions everywhere, then relaunch Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
killall Finder
# Undo — hide them again
defaults write NSGlobalDomain AppleShowAllExtensions -bool false
killall Finder
Renaming cleanly once extensions are visible
A few habits keep every rename safe now that you can see the whole name:
- Click once and press Return to enter rename mode. macOS selects just the base name, so typing replaces the words and leaves
.pdfor.xlsxalone. - Never delete the final dot. Everything after the last
.is the extension; keep it exactly as it was unless you truly mean to convert the file. - Renaming many files? Select them all, right-click, and choose Rename… for Finder's built-in batch tool. It only edits the name portion and preserves each file's extension automatically.
If you do change a suffix on purpose, macOS shows a confirmation dialog — "Are you sure you want to change the extension?" — because renaming a file's suffix doesn't convert its contents. A .png renamed to .jpg is still a PNG inside, just mislabeled. That warning is a safety net worth keeping on; you can read how it works in our guide to the Finder change-extension warning.
Showing every filename extension is one of the 90+ hidden macOS settings Mainspring exposes as a labelled, one-click toggle — reversible any time, no Terminal, no digging through Finder preferences.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
Renaming a whole folder at once
Cleaning up a batch of exports or scans? Finder's multi-select rename tool can add sequential numbers, find-and-replace text, or apply a prefix without ever touching the extensions. See how to batch rename files on Mac for the full workflow.