Skip to content

File extension vs file type

A file extension is the label after the last dot. A file type is what the bytes inside actually represent. Most of the time the two agree; when they do not, the bytes win. This page explains why and how to spot the difference in under a minute.

  • Plain-English explainer
  • 4 verdicts covered
  • Bytes never leave your browser

Key facts

  • Extension

    The trailing label after the last dot in a filename. Trivial to change. A hint, not a contract.

  • File type

    The format identified by the bytes inside the file. Detected by reading the first few bytes (the magic-byte signature).

  • When they diverge

    When someone renames the file, when an extension was never set, or when the file is a polyglot (valid as more than one format at once).

  • How we report it

    Four verdicts: MATCH, MISMATCH, AMBIGUOUS, UNKNOWN. Each is a deterministic answer about format identity.

A file extension is the trailing piece of a filename, like .pdf or .docx. The file type is what the bytes actually represent. The two usually match, but they do not have to.

Why they diverge

Anyone can rename a file. invoice.exe renamed to invoice.pdf still has the bytes of a Windows executable; only the label changed. Your operating system shows a PDF icon, but double-clicking would launch the executable anyway (or a security tool would block it). The extension is cheap and lies easily.

The file type is determined by the bytes themselves, the magic-byte signature at the start of the file. We have a longer explainer at What is a magic number?.

How to tell which is right

  • MATCH

    Extension and bytes agree. The reassuring case.

  • MISMATCH

    Extension says one thing, bytes say another. Slow down before opening.

  • AMBIGUOUS

    Multiple known formats fit the same prefix (e.g. every Office document is a ZIP).

  • UNKNOWN

    No recognised signature. Often plain text; we then run an AI content classifier on desktop.

Frequently asked questions

Drop a file and see the verdict

The check runs locally in your browser. One of four verdicts in under a second. The bytes never leave your device.

Open the File Type Checker