Identify an Unknown File Extension

Last reviewed on May 11, 2026

You've been sent a file. The icon is generic, the extension is something you've never seen, and double-clicking produces the familiar "Windows can't open this file" or "macOS doesn't recognise this file type" dialog. Before installing anything, the most useful thing to do is identify what the file actually is. That makes everything that follows — installing the right software, converting it to a friendlier format, or recognising that it's already broken — much easier.

The diagnostic order below is built to fail fast. Each step takes a few seconds, and as soon as one of them produces a clear answer, you can stop and act on it.

Step 1: Make sure you can actually see the extension

Windows and macOS both hide common file extensions by default, which means the part you can see may not be the full extension. A file that looks like invoice may really be invoice.pdf.exe on disk — a classic phishing pattern. Before guessing, force the operating system to show the real extension:

Mobile platforms hide extensions even more aggressively. On iOS, the Files app shows a type description rather than the extension; tap-and-hold and choose "Get Info" to see the real filename. On Android, file manager apps typically expose the extension under a long-press or rename action.

Step 2: Read the context the file came from

Before researching the extension, look at where the file appeared. The context is often a stronger clue than the extension itself:

Context also tells you when not to trust an extension. A file received from a stranger with an executable extension (.exe, .scr, .bat, .vbs, .js, .lnk, .msi, .reg, .ps1, .com, .pif) should be treated as suspicious regardless of the icon. Files received in archives that contain a hidden executable alongside a fake document icon are one of the most common malware delivery patterns.

Step 3: Look the extension up

A direct search of the form "what is .xyz file" produces an answer for the overwhelming majority of extensions in use. Useful structured references include:

Sanity-check the result against the file's size. A 12-byte file that claims to be a PSD is almost certainly truncated. A 4 GB file that claims to be a JSON document is more likely a database or backup blob with a wrong extension.

Step 4: Inspect the first few bytes

The extension is just a label; the bytes are the file. When the extension lookup gives an answer that doesn't fit, or when the extension is missing entirely, peeking at the start of the file is the single most useful diagnostic step. Most formats start with a fixed byte sequence — a "magic number" — that identifies them regardless of what the filename claims.

You don't need a hex editor for the basics. On Windows, PowerShell's Get-Content -TotalCount 1 -Encoding Byte shows the leading bytes; on macOS and Linux, the file command does the same job and reports the detected format. For a deeper view, see our dedicated guide on file signatures and magic numbers.

Step 5: Decide whether the file is what it claims to be

Now compare three things: the extension, the file's reported size and structure, and the detected magic number. Three outcomes are common:

Step 6: Open it with the right tool

Once the format is identified, the next step depends on what it is:

If nothing fits and you have no way to find software for the format, opening a file without its native software explains the partial-fallback approaches that sometimes salvage at least the content.

Common mistakes to avoid

When the answer is "you can't open it at all"

Some files are tied to a specific machine, account, or hardware key — DRM-protected media, encrypted backups, and licence-locked project files among them. If your identification work concludes that the file is one of those, no third-party tool will open it without the appropriate credentials. The right move is to go back to the source — the original sender, the application that created the file, or the support channel for the platform that encrypted it.

For everything else, the diagnostic order above takes a few minutes at most and lands on a clear next step almost every time.