File Type Detector

Find out what a file really is by reading its first bytes, not its name.

A file's name says one thing, its contents may say another. This tool reads the first bytes of a file, where formats put their signatures, and tells you what it really is: image, document, archive, audio, video, font or program. It warns when the extension doesn't match, which can be a sign something is off.

How to use it

  1. Choose or drop a file.
  2. Read the detected type and MIME type.
  3. Check the extension warning.
  4. Treat mismatches with care.

When it helps

  • Checking a suspicious attachment.
  • Identifying a file with no extension.
  • Finding what a renamed file really is.
  • Debugging upload problems.

Good to know

  • A mismatch can be innocent, but it can also disguise something harmful.
  • Word, Excel and many other formats are ZIP files underneath, so they show as ZIP archives.
  • Plain text is reported when no signature is found.

How detection works

Many formats begin with fixed bytes called magic numbers: PNG starts with 89 50 4E 47, JPEG with FF D8 FF, PDF with the text %PDF, and ZIP with PK. The tool reads the start of your file and compares it to a table of known signatures.

If nothing matches but the content is readable text, it reports plain text.

Worked example: a renamed file

Someone sends invoice.pdf, but the tool says it's a Windows program. That's a red flag: attackers rename executables to disguise them. Don't open it, and report it.

On the other hand, a .docx that shows as ZIP is normal, since Office files are ZIP archives containing XML.

Why extensions aren't enough

Extensions are just part of the name, and anyone can change them. Operating systems use them for convenience, but a careful check looks at the contents. Servers that accept uploads should detect the type this way, and not trust the name or the declared type.

Even then, treat uploads as untrusted: scan them, store them outside the web root and serve them with safe headers.

Limits

The tool recognises a few dozen common formats and can't tell apart formats that share a container, such as DOCX, XLSX and JAR files, which are all ZIP. A file can also be valid in two formats at once.

For deeper inspection, use dedicated analysis tools.

Safe handling of unknown files

If a file's type doesn't match its name, don't open it. Scan it with security software, or open it in an isolated environment. Be extra careful with scripts, installers and documents asking you to enable macros.

When in doubt, ask the sender through another channel whether they really sent it.

Check before you share

Before sending a file to others, check that its real type matches what you say it is. A report that is secretly an old spreadsheet format, or a photo that is really a different image type, can cause problems on the other end.

Questions

Does it upload my file?

No, only the first part is read locally.

Can it detect every format?

No, just common ones.