Black FridayBlack Friday: Folia Files is 30% off. One payment, yours for good.Until November 29Get the offer

All articles

Change File Extension on Mac: One File or Many at Once

· 6 min read

To change a file extension on a Mac, you rename the file and change the letters after the last dot. For one file, select it in the Finder, press ↩, edit the end of the name and confirm when the Finder asks. For many files at once you have three ways: the Finder's Rename window with Replace Text, a one-line zmv command in Terminal, or a batch rename that shows every new name before anything changes, such as the Extension rule of Folia Files. Here are all three, after the one thing to know first: a new extension doesn't convert the file.

Changing the extension doesn't convert the file

The extension is only the end of the name. It tells macOS which app opens the file and which icon to show; the data inside stays exactly as it was. Renaming is the right fix when only the label is wrong:

  • .jpeg → .jpg, .tif → .tiff, .htm → .html: the same format under another name;
  • .JPG → .jpg: the same extension in lowercase, which some websites and scripts expect;
  • .txt → .md: Markdown is plain text, so a text note simply becomes a Markdown note.

It isn't enough when you need another format. A HEIC photo renamed .jpg is still a HEIC photo, a .mov renamed .mp4 is still a QuickTime movie, and the app or website that wanted a real JPEG or MP4 may refuse it. For those, convert the file instead (last section).

If a rename goes wrong, nothing is lost: give the file its old extension back and it opens as before.

Show the extensions first

You can only edit what you can see. In the Finder, choose Finder › Settings, click Advanced and turn on Show all filename extensions. Folia Files shows extensions by default (Settings › Panes › Show filename extensions).

Change the extension of one file in the Finder

  1. Select the file and press ↩.
  2. Replace the letters after the last dot, then press ↩ again.
  3. The Finder asks: "Are you sure you want to change the extension from “.jpeg” to “.jpg”?" Click Use .jpg.

That question can be turned off with Show warning before changing an extension, in the same Advanced settings. Fine for one file, tedious for fifty.

Change the extension of many files in the Finder

The Finder's batch rename works on extensions too:

  1. Select the files, Control-click one of them and choose Rename.
  2. In the pop-up menu of the Rename Finder Items window, choose Replace Text.
  3. In Find, type the old extension with its dot (.jpeg); in Replace with, the new one (.jpg).
  4. Click Rename. If the result is wrong, Edit › Undo Rename (⌘Z) brings the names back.

Type the dot: Find looks through the whole name, so jpeg alone could also change a file called "jpeg export.jpeg" in the middle of its name. Two more limits: the window shows one example rather than every new name, and it only works on the files you selected, so files spread over many subfolders mean several rounds.

Change file extensions with Terminal

macOS uses the zsh shell by default, and zsh comes with zmv, a renaming command that checks before it acts. Open Terminal, go to the folder and run:

cd ~/Pictures/Export
autoload -U zmv
zmv -n '(*).jpeg' '$1.jpg'

With -n, zmv only prints the mv commands it would run. If the list looks right, run it again without -n:

zmv '(*).jpeg' '$1.jpg'

If one of the new names already exists, zmv stops with "file exists" and renames nothing at all. To include every subfolder, use zmv '(**/)(*).jpeg' '$1$2.jpg'.

You will also find this classic loop:

for f in *.jpeg; do mv -n -- "$f" "${f%.jpeg}.jpg"; done

mv -n never overwrites a file, but it skips it without a word. One trap is worth knowing: Mac disks ignore case by default, so for .JPG → .jpg, mv -n sees the new name as already taken and does nothing at all. zmv handles that case. Terminal has no undo, so try it on a copy of the folder first.

Change the extension of many files with a preview, in Folia Files

The Batch Rename tool of Folia Files has a rule made for this, Extension: it changes only the extension, shows every new name before anything happens, and the whole batch is undone with one ⌘Z.

Four photos selected in Folia Files, their context menu open on Batch Rename 4 Items…, with the Images (4) submenu a little lower

  1. Choose the files. Select them in a pane, right-click and choose Batch Rename n Items…. Or open Tools › Batch Rename… (⇧⌘R) and drop a whole folder on the Files list; then click Selection Options and type jpeg in Extensions to take only those files. Subfolders are included: turn off subfolders to stay in the folder itself.
  2. Add the rule. Under Rules, click Add and choose Extension. Type the new extension (jpg; a leading dot is fine) in New extension (empty = keep). With the field empty and lowercase ticked, the rule only lowercases: .JPG becomes .jpg.
  3. Check the preview. Each row shows the Current Name and the New Name. A file whose new name is taken ("photo.jpeg" next to an existing "photo.jpg") is marked Already exists, two files that would get the same name are marked Same name as another item, and both are left out: nothing is overwritten.
  4. Rename. Click Rename n Item(s)… (⌘↩), check the summary and confirm. One ⌘Z puts every name back, and the batch stays in the Operations history. To leave the originals untouched, choose On copies, next to the originals before you click.

Batch Rename in Folia Files on the photos of a trip: one Extension rule set to jpeg, and the preview listing each current .jpg name next to its new .jpeg name

A few details that help:

  • A file that has no extension gets the new one: handy for files saved without any.
  • The Replace rule works on the name without its extension, so it can't touch the extension by mistake; changing it is the Extension rule's job.
  • Rules apply in order, so you can change the extension and, in the same pass, add a date or a number to the names.

More on the tool on the Batch Rename page and in its documentation.

When you need to convert, not rename

If the goal is a JPEG that really is a JPEG, or an MP4 that plays everywhere, convert. In Folia Files, select pictures, right-click and open Image (Images (n) for several), then Convert To › JPEG, PNG, HEIC or TIFF: each picture gets a copy in that format next to it, with the same name and the new extension. For videos, Video › Convert to MP4 (H.264) or Convert to HEVC write a new file next to the original. The originals are never changed. Step by step: how to convert HEIC to JPG in bulk and how to convert MOV to MP4.

Quick answers

  • Does changing an extension damage the file? No. Only the name changes; put the old extension back and the file opens as before.
  • Can I undo a batch change? In the Finder, Edit › Undo Rename right after. In Folia Files, ⌘Z or the Operations history. In Terminal, no: run the opposite command.
  • Can I change the extension of files in several folders at once? With zmv and its **/ pattern, or in Folia Files by dropping the top folder on the Files list with subfolders on.