Skip to content
Toolew.com

File Type Detector

Identify a file’s real type from its magic-byte signature, flagging a mismatch against its extension, a common sign of a renamed or mislabeled file.

Runs in your browser. Your data is not uploaded.
Loading tool…

Tool guide

What this tool does

File Type Detector reads a file’s first few bytes and matches them against a table of known magic-byte signatures (the same technique the Unix `file` command uses) to identify its real content type, flagging any mismatch against its file extension, a common sign of a renamed, corrupted, or mislabeled file.

A file’s extension is just a naming convention, anyone (or any process) can rename a .jpg to .txt without changing its actual content, which is why relying on the extension alone to know what a file really is isn’t fully reliable.

This detector instead reads the file’s first few bytes, its "magic number", and matches them against a table of known signatures covering images, archives, documents, audio, video and more, the same fundamental technique the Unix `file` command uses, then flags clearly if the detected type doesn’t match the file’s extension.

How to use File Type Detector

  1. Choose a file to analyse.
  2. Review the Detected type result.
  3. Check for a mismatch warning against the file’s extension.
  4. Inspect the raw first 32 bytes in hex if you need to investigate further.

Tips for better results

  • A mismatch warning doesn’t always mean something malicious, it’s equally often just a file renamed by accident, a failed or partial download, or a format the detector’s signature table doesn’t cover.
  • Several common formats (like .docx, .xlsx and .pptx) are internally just ZIP archives, so they correctly detect as "ZIP archive" at the byte level, that’s expected, not a mismatch to worry about.
  • An "unrecognised" result doesn’t mean the file is invalid, it just means its signature isn’t in this detector’s table, many plain text-based formats have no distinctive magic bytes at all.
  • Only the first 32 bytes are read, so this is a fast, lightweight check, not a full file integrity validation.

Common use cases

  • Verifying a downloaded file is actually the type it claims to be before opening it.
  • Investigating why a file with a given extension won’t open correctly in its expected application.
  • Checking a batch of files for extension mismatches after a bulk download or extraction.
  • Learning how magic-byte file type detection works with real, concrete examples.

Common mistakes to avoid

  • Treating "unrecognised" as proof a file is corrupted or fake; many legitimate formats (especially plain text-based ones) simply have no distinctive magic-byte signature to detect.
  • Being alarmed that a .docx or .xlsx file detects as a "ZIP archive"; that’s correct and expected, since those Office formats are internally ZIP containers.
  • Assuming this check guarantees a file is safe; magic-byte detection identifies format, not malicious content hidden within a file that is otherwise a genuinely valid example of its detected type.

Frequently asked questions

How does magic-byte detection work?

Many file formats begin with a distinctive, fixed sequence of bytes (a "magic number"); this tool reads a file’s first bytes and compares them against a table of known signatures to identify the format, regardless of what extension the file currently has.

Why does my .docx file show as a ZIP archive?

Modern Office formats (.docx, .xlsx, .pptx) are internally ZIP containers holding XML files; detecting "ZIP archive" for one of these is correct, not an error.

Is my file uploaded anywhere?

No, only the first 32 bytes are read directly in your browser; the file itself is never uploaded anywhere.

What does an extension mismatch actually mean?

It means the file’s actual content doesn’t match what its extension claims, commonly caused by a manual rename, a corrupted or incomplete download, or occasionally a deliberately disguised file, worth investigating before trusting the file.

Feedback & suggestions

Help us improve File Type Detector. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.