Manatee

Changed a file extension and now it will not open on a Mac

Renaming a file from .heic to .jpg, or from .webp to .png, does not convert it. The extension is a label on the outside; the data inside stays exactly what it was, so the app that now receives the file expects one format, finds another, and refuses. The fix is quick: put the original extension back, which makes the file open again with nothing lost, then convert it with a tool that actually rewrites the data.

Why a new extension does not make a new format

A Mac uses the extension to decide two things: which app opens the file, and what kind of data that app should expect. Change .heic to .jpg and Finder now hands the photo to whatever handles JPEG, and any website you upload it to assumes JPEG too. But the bytes are still a HEIC picture. Some apps look past the name, read the data and cope. Many trust the label, try to read JPEG, and fail with a message about an unsupported or damaged file.

The good news is in the same fact. Renaming changes nothing inside the file, so nothing has been damaged. Changing the name back restores everything.

When renaming happens to work

A few pairs let a rename get away with it, which is why the trick has a reputation:

  • MOV and MP4. Both are built on the same file structure. A MOV holding H.264 video and AAC audio often plays when renamed to .mp4, though some sites and devices check more than the name. A MOV holding a codec MP4 players do not expect, such as ProRes, will not.
  • M4A, M4B and M4R. These are the same audio container used for music, audiobooks and ringtones. The letter changes how Apple’s apps file the track, not what is in it.
  • Plain text. A .txt renamed to .csv or .md is still text, and any app that reads text will open it. Whether it looks right depends on what is in it.

Outside these, a rename between formats does not work. HEIC to JPEG, WebP to PNG, WAV to MP3, MKV to MP4 and DOCX to PDF all need a real conversion. Container versus codec explains why two video files with the same extension can still behave differently.

Put the original extension back

First make sure you can see the whole name. Finder hides extensions by default, and a hidden one makes renames go wrong quietly: type photo.jpg over a file whose real name is photo.heic and you can end up with photo.jpg.heic, which Finder shows as photo.jpg.

  1. Choose Finder, Settings, then Advanced, and turn on Show all filename extensions.
  2. Select the file and press Return to edit the name. Change the extension back to the original.
  3. When Finder asks whether you are sure you want to change the extension, click the button that uses the new one (for example Use .heic).
  4. Double-click the file to check that it opens.

Not sure what you typed? Select the file, choose File, Get Info, and look at Name & Extension. If two extensions appear, delete the one you added.

If you renamed a whole folder of files with a command or a batch rename, undo it the same way. In Terminal, in that folder, this renames every .jpg back to .heic:

for f in *.jpg; do mv "$f" "${f%.jpg}.heic"; done

Only run it in a folder where every .jpg really is a HEIC underneath. The next section shows how to check.

Find out what the file really is

If you do not remember the original format, ask the file. The file command in Terminal ignores the name and reads the first bytes, where every common format announces itself. Type file and a space, drag the file onto the Terminal window, and press Return.

file ~/Desktop/photo.jpg
photo.jpg: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile

That answer means HEIC, whatever the name says. A real JPEG reports JPEG image data, a PNG reports PNG image data, and a WebP mentions Web/P image. A file with no extension has a longer list of what these signatures look like.

Video needs one more step. file tells a MOV from an MP4, but not which codec is inside. Once the file opens in QuickTime Player, Window, Show Movie Inspector lists the codecs.

Convert it properly

With the name telling the truth again, use a tool that rewrites the data.

  • Photos and images. Open the file in Preview, choose File, Export, and pick JPEG, PNG, HEIC or TIFF from the Format menu. For several at once, select them in Finder, right-click, and choose Quick Actions, Convert Image.
  • Video. QuickTime Player’s File, Export As writes a new MOV at the resolution you choose. It does not write MP4, and it cannot open formats macOS does not play, such as MKV or WebM.
  • Audio. The Music app can make an MP3 or AAC version of a track in its library once you set the encoder in its Import Settings.
  • Documents. TextEdit opens RTF, DOCX and plain text documents and can save a copy in another of those formats.

When the job spans several kinds of file, or the format is one macOS does not handle, Manatee does it from one window. Choose Convert, drop in the files, and pick one of 15 targets: JPEG, PNG, HEIC, TIFF, MP4, MOV, GIF, MP3, M4A, WAV, FLAC, DOCX, RTF, TXT or SRT. It reads 122 input types, including WebP, AVIF, MKV, WebM, FLAC and most camera raw files. Each result is written as a new copy beside the original, and the source is never modified. Everything runs on the Mac with nothing uploaded. It is free for 24 hours with every feature, then $9 once.

Fix the name before converting either way. A file that lies about its own format can confuse any converter, and the result is easier to trust when the label and the data agree.

If it still will not open with the right extension

When the correct extension is back and the file still refuses, the rename was not the problem. Check the size in Get Info: a file of zero bytes, or one far smaller than similar files, was cut short during a download or copy. If file reports only “data”, the start of the file is not a format it recognizes, which points to damage or encryption.

For a damaged video, PDF or Word document, Manatee’s Repair mode reads what is left and reports the outcome plainly as Fixed, Partial or Not fixable, again writing a new copy rather than touching the original. The file someone sent you won’t open walks through the other causes.

Questions

Can changing an extension damage a file? No. Renaming touches the name only. Change it back and the file is exactly as it was.

Why does Finder warn me when I change an extension? The new extension changes which app opens the file, and macOS cannot know whether you meant that. The warning is about the label, not the contents.

A website only accepts .jpg. Can I rename my HEIC? Not safely. The upload may pass the name check and then fail, or arrive as a broken image. Convert to JPEG instead; HEIC explained covers why so many sites refuse it.