Manatee

A file with no extension that will not open on a Mac

Someone sends you a file called recording or attachment or data, with nothing after the name. Double-clicking gets you a dialog asking which app to use, or a text editor full of garbage. The file is probably fine. macOS just has no idea what it is, because the thing it usually relies on is missing.

Every file type has a recognizable signature in its first few bytes. Reading those bytes tells you what you are holding, and adding the matching extension makes the Mac treat it normally again.

Why the extension matters so much

macOS decides how to handle a file using a Uniform Type Identifier, and in practice it works that out from the filename extension first. A Finder-level type code can also exist, but files that have crossed a network, a Windows machine, an email gateway or a download link have usually lost it.

So the Finder is not being obtuse. Faced with recording, it genuinely has nothing to go on and asks you.

Extensions go missing for a few ordinary reasons: an attachment renamed by a mail system, a download that took its name from a URL with no filename in it, a file copied from a system where extensions are optional, an export from an app that names its output itself, or someone who hid extensions in the Finder and renamed the file without realizing what they removed.

Read the file’s signature

Terminal has a command for exactly this. Type file with a trailing space, drag the file into the window, and press Return:

file ~/Downloads/recording

Answers look like:

recording: ISO Media, MP4 v2 [ISO 14496-14]
recording: PDF document, version 1.7
recording: Microsoft Word 2007+
recording: JPEG image data, JFIF standard 1.01
recording: Zip archive data, at least v2.0 to extract

That is usually the whole investigation. file reads the leading bytes and compares them against a large table of known signatures, so it does not care what the file is called.

Two answers deserve care. Zip archive data is ambiguous, because DOCX, XLSX, PPTX and EPUB are all zip archives underneath; look inside with unzip -l and the folder names will tell you which. data means the signature matched nothing, which points at either an unusual format or a damaged file, and the next section covers both.

To see the bytes directly:

xxd -l 16 ~/Downloads/recording

A few signatures worth recognizing on sight: %PDF for PDF, PK for any zip-based format, ftyp a few bytes in for MP4 and MOV, RIFF for WAV and AVI, ID3 or ÿû for MP3, ‰PNG for PNG, and ÿØÿ for JPEG.

Add the extension

Once you know, renaming is the whole fix. In the Finder, click the name, press Return, type the extension, and confirm when asked whether you want to change it.

Make sure you can see what you are doing first. In the Finder, choose Settings from the Finder menu, click Advanced, and turn on “Show all filename extensions”. Working on a file with no extension while extensions are hidden is how a second one goes missing.

Match the extension to what file reported, not to what you expect: ISO Media, MP4 becomes .mp4, QuickTime movie becomes .mov, Microsoft Word 2007+ becomes .docx and the older Composite Document File usually means .doc. Getting this wrong does not damage anything, it just means the file still does not open, so try again.

If the name is one you would rather keep intact, duplicate the file with Command-D and rename the copy.

If the Mac still will not open it

Two possibilities remain, and they are easy to tell apart.

The format is real but macOS does not support it. Plenty of formats are perfectly healthy and simply have no built-in handler: MKV, WMV, FLV, AVI with older codecs, WMA audio, OGG, and various camera formats. The file is intact and needs converting rather than repairing. Container versus codec explains why a file with a familiar extension can still be refused, which is the same situation one step later.

Manatee accepts 122 input types, including most of the formats the Finder shrugs at, and converts them to something macOS opens natively, running entirely on the Mac with no upload. Once you have established the real type, that is a short step.

The file is damaged. This is what file reporting plain data usually means, especially for something that arrived by download or over a network. A truncated video, a partially copied PDF or a zip with a missing directory all lose the structure that identification depends on. How to check whether a video file is corrupted is the quick test for video, and why files get corrupted and what can actually be recovered sets honest expectations for the rest.

Manatee repairs corrupt video, PDF and Word documents in that case, always writing a new copy alongside and reporting the result as Fixed, Partial or Not fixable rather than pretending. A file that lost its tail in transfer is often recoverable up to the point where the data stops.

A quick decision path

  1. Run file on it. If it names a format, rename with that extension and try again.
  2. If it opens, you are done.
  3. If it opens but in the wrong app, right-click, choose Get Info, and set Open With, then click Change All.
  4. If the format is one macOS does not handle, convert it.
  5. If file says data, or the app that should open it refuses, treat it as damaged and test or repair it.

Step 3 is worth knowing separately, because a file with a correct extension can still open in the wrong place if something earlier claimed the type. What Finder’s Get Info shows and what it hides covers that panel.

Files that never had an extension to begin with

Not everything without a dot in its name is broken. Configuration files, Makefile, README, git internals, Unix executables and many hidden files in your home folder are named that way on purpose, and most of them are plain text.

file ~/Downloads/something && head -20 ~/Downloads/something

If file says ASCII text or UTF-8 text, open it in TextEdit or any code editor and read it. Adding .txt is optional and harmless, though it is better not to rename anything that a program is expecting to find by its exact name.

Questions

Does renaming a file convert it? No. The extension is a label describing the bytes, not a transformation of them. Renaming a MOV to .mp4 tells the Mac to expect MP4, which may work since the containers are related, but renaming an MKV to .mp4 usually just produces a different error.

Is it safe to open an unknown file to see what it is? Reading the signature with file or xxd is safe, because neither one executes anything. Double-clicking an unknown file from an untrusted source is a different matter, so identify it first and then decide.

Why did the extension disappear after an email attachment? Some mail systems rewrite attachment names, and some clients save using the MIME type instead of the filename. Asking the sender to zip the file before attaching it avoids the whole category.

The file is 0 bytes. Can anything be done? No. A 0 byte file contains nothing to identify or recover, and the failure happened before or during the copy. Ask for it again from the source.