LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

🔬 File Type Identifier (Magic Bytes)

Drop in a file to see what it really is from its signature bytes — and get a warning when a file's extension doesn't match its actual content.

…or paste the first bytes as hex

Every binary format begins with a "magic number" — a fixed byte signature (PNG is 89 50 4E 47, PDF is %PDF, ZIP is PK…). This reads those leading bytes and reports the true type regardless of the file's name, and flags when a file's extension doesn't match its real content. Plain-text formats (CSV, JSON, HTML, code) have no magic number and read as "unrecognized." 🔒 Only the first bytes are read, entirely in your browser — nothing is uploaded.

Rate this tool:
Anonymous — no account, no identifier

How the file type identifier (magic bytes) works

Almost every binary format begins with a fixed "magic number" — a signature at the start of the file. A PNG always starts with the bytes 89 50 4E 47, a PDF with %PDF, a ZIP (and the Office and EPUB formats built on it) with PK. This tool reads just the first bytes of your file, matches them against a table of well-documented signatures, and reports the real format and MIME type. If you supply the file (so it knows the name), it also compares the detected type to the extension and flags a mismatch. You can also paste the leading bytes as hex.

The extension on a file is just a label — it can be wrong by accident (a mislabelled download) or changed on purpose to disguise what something is. What actually determines how a file opens is its content, and the magic bytes reveal that. This is a genuine security check: an attachment named invoice.pdf whose bytes are actually a Windows executable is a classic trick. The signature table is a frozen set of published format signatures, so results are exact and don't depend on any server. Note that plain-text formats (CSV, JSON, HTML, source code) have no magic number and read as "unrecognized" — that's expected, not an error.

Frequently asked questions

What are magic bytes (a file signature)?

A fixed sequence of bytes at the very start of a file that identifies its format — like 89 50 4E 47 for PNG or %PDF for a PDF. Programs read these to know how to open a file, independent of its extension.

How do I find a file's real type if the extension is wrong?

Read its magic bytes. This tool does that: drop the file in and it reports the true format from the signature, and warns you when that doesn't match the file's extension.

Why does it say a .docx or .jar is a ZIP?

Because they genuinely are ZIP archives underneath — Office documents (docx/xlsx/pptx), JARs and EPUBs are all ZIP containers, so they share the PK signature. The tool lists those possibilities.

Why is my text file "unrecognized"?

Plain-text formats — CSV, JSON, HTML, XML, source code — have no magic number, so there's nothing to match. That's expected. Only binary formats carry a signature.

Is my file uploaded?

No — only the first 512 bytes are read, entirely in your browser, and nothing is transmitted. You can even paste just the leading hex bytes instead of a file.

Related privacy & security tools

From the blog