How to Check a File's Real Type (Not the Extension)

Updated 2026-06-21

To check a file's real type, ignore its extension and read its magic bytes — the few signature bytes at the very start of the file that identify the actual format. Drop the file into a magic-byte inspector and it reports the true type, even if a .jpg is really a PNG or an .mp4 is really a HEIC. The File Type & Hex Inspector does this entirely in your browser, so nothing is uploaded.

Why the extension lies

A file extension is just text in the filename — anyone can rename report.pdf to report.jpg and the bytes inside never change. Operating systems and browsers often trust that name, which is why a "broken" image or a file that won't open is usually a file whose extension doesn't match its contents.

The reliable signal is the file signature. Most formats begin with fixed bytes: PDFs start with the characters %PDF, PNGs begin with a byte sequence ending in PNG, ZIP-based files (including .docx, .xlsx, .odt, and .jar) start with PK, and JPEGs open with FF D8 FF. Reading those bytes tells you what the file genuinely is.

How to check it, step by step

  1. Open the File Type & Hex Inspector and drop any file onto the zone, or click to browse.
  2. Read the top row: Detected type (from the magic bytes), Size, and the Browser MIME your system declared.
  3. Check the Signature line for the real extension and MIME the bytes correspond to.
  4. Watch for a warning banner — it appears when the extension contradicts the actual bytes, flagging a mislabeled or disguised file.

Worked example: you download invoice.pdf but it won't open. Drop it in. If the Detected type reads ZIP archive (or .docx/.xlsx/.odt/.jar), the file is actually an Office document or archive wearing a PDF name — rename it accordingly and it opens.

Reading the hex dump

Below the verdict is a classic hex dump in three columns: an 8-digit offset on the left, the raw bytes as two-digit hex in the middle, and a printable ASCII rendering on the right (non-printable bytes show as dots). This is the same layout developers use to eyeball headers, spot embedded text, or confirm a signature by hand. A copy button grabs the dump text for a bug report or notes.

Formats it recognizes include PDF, JPEG, PNG, GIF, BMP, TIFF, ICO, WebP, HEIC, gzip, bzip2, 7-Zip, RAR, ZIP, MP3, Ogg, FLAC, WAV, MP4, MOV, AVI, PostScript, ELF, and Windows EXE.

A note on size and privacy

Only the first 8 KB of the file are read — enough to detect the type and build the dump, while keeping huge files from freezing the tab. If a file is larger, a notice tells you the dump shows the first 8 KB. Crucially, that slice is read locally in your browser: the file is never uploaded, there's no signup, and nothing leaves your machine.

Ready to see what a file actually is? Open the File Type & Hex Inspector and drop a file in.

Try the File Type & Hex Inspector →