OnlyFormat

Format Detective

Find out what a file really is — detected from its bytes, not its extension. Catches misnamed files before a conversion fails.

Only the first 4 KB is read — never uploaded

Why a file extension can't be trusted

A file name like photo.jpg is just a label. The part after the dot — the extension — is metadata that anyone can rename in a second, and it is not stored inside the file at all. The operating system uses it as a hint to pick which app opens the file, but the actual data on disk may be something completely different.

That gap causes real, everyday problems. You download an image from a chat app and it's saved as .jpg, but it's really a WebP — so your old photo editor refuses to open it. A "PDF" emailed to you won't open because it's actually an HTML phishing page wearing a PDF name. A converter throws "invalid file" even though the extension looks right. Format Detective answers the one question those errors never tell you: what is this file, really?

How magic-byte detection works

Almost every binary format begins with a fixed sequence of bytes called a magic number or file signature. It sits at the very start of the file (offset 0) and identifies the format regardless of the file name. Format Detective reads only the first few kilobytes of your file in your browser and compares them against a table of known signatures.

  • PNG starts with 89 50 4E 47 0D 0A 1A 0A (the bytes spell ".PNG" with guard characters).
  • JPEG starts with FF D8 FF.
  • PDF starts with 25 50 44 46 — the ASCII text %PDF.
  • GIF starts with the literal text GIF87a or GIF89a.
  • WebP is a RIFF container with WEBP at byte 8.
  • AVIF and HEIC share the ISO-BMFF ftyp box at byte 4; the four-character "brand" right after it tells them apart.

Text formats (SVG, HTML, XML, JSON) have no binary signature, so they are detected by decoding the first characters and checking the structure — for example, an SVG starts with <svg or an XML declaration.

The ZIP family surprise

One signature trips up a lot of people: 50 4B 03 04 ("PK"). It means ZIP — but DOCX, XLSX, PPTX, EPUB, JAR, APK and ODT are all ZIP archives internally. Microsoft Office and OpenDocument files are simply renamed ZIP packages full of XML. So if Format Detective reports "ZIP archive" for a .docx, that's correct at the byte level — the office format is layered on top of ZIP.

A small security angle

Extension/content mismatch is a classic trick in malware and phishing. An attachment named invoice.pdf that is really an HTML file, or an .jpg that is really an executable container, is trying to get past a quick visual check. Detecting the true type before you open or forward a file is a cheap, useful habit. Format Detective never uploads your file — detection happens locally in your browser — so you can inspect even sensitive files safely.

How to Use

  1. Drag & drop any file, or click to browse.
  2. Read the Real format badge — that's what the bytes say it is.
  3. If you see an extension mismatch warning, rename or convert the file as suggested.
  4. Use the Convert this file links to jump straight to the right converter.

FAQ

Is my file uploaded anywhere?

No. Detection reads only the first 4 KB of the file directly in your browser using the File API. Nothing is sent to a server.

Why does it say my .docx is a "ZIP archive"?

Because it literally is one. DOCX, XLSX, PPTX and EPUB are ZIP packages of XML files. The byte signature is ZIP; the office format is a layer on top. That's expected, not an error.

My converter rejected a file — can this tell me why?

Often, yes. If the detected format doesn't match the extension (e.g. a ".jpg" that's really a WebP), most converters that key off the extension will refuse it. Convert from the real format instead.

It says "Unrecognized binary format" — what now?

The first bytes didn't match any known signature. The file could be encrypted, compressed with an uncommon tool, or a proprietary format. The 16-byte signature shown at the bottom can be searched online to identify rarer types.

Can it detect a renamed image (e.g. .png renamed to .jpg)?

Yes — that's exactly what it's for. The detection ignores the name entirely and reads the signature, so a PNG renamed to .jpg is reported as PNG with a mismatch warning.

⚠️ Reference Only

Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.

Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.