Skip to main content

Detect File Types by Magic Bytes Online Detect file format by analyzing magic bytes (file signature) in the header.

File Format Identifier illustration
๐Ÿ”„

File Format Identifier

Detect file format by analyzing magic bytes (file signature) in the header.

1

Upload any file

Drop or select any file to identify.

2

View detection result

See the detected format, MIME type, and confidence level.

3

Inspect hex dump

View the first bytes of the file in hex format.

Loading tool...

What Is File Format Identifier?

File Format Identifier detects file types by analyzing magic bytes โ€” the specific byte sequences at the beginning of files that identify their format. Unlike relying on file extensions (which can be changed or wrong), magic byte analysis examines the actual file content. The tool checks against 30+ known file signatures covering images (JPEG, PNG, GIF, WebP), documents (PDF, Office, RTF), archives (ZIP, GZIP, RAR, 7Z), audio (MP3, FLAC, OGG), video (MP4, WebM), fonts (WOFF, TTF, OTF), and more. It also displays a hex dump of the first 64 bytes for manual inspection.

Why Use File Format Identifier?

  • Identifies files by actual content, not just file extension.
  • 30+ file signatures covering all common formats.
  • Hex dump display for manual inspection.
  • Shows detected extension, MIME type, and confidence level.

Common Use Cases

Unknown Files

Identify files with missing, incorrect, or unfamiliar extensions.

Security Analysis

Verify that file extensions match actual content to detect disguised files.

Data Recovery

Identify recovered files that have lost their extensions or metadata.

Development

Verify file type detection logic and examine file headers during development.

Technical Guide

The tool reads the first 512 bytes of the uploaded file as an ArrayBuffer and checks them against a database of known magic byte sequences. Each signature specifies: the byte values to match, optional byte offset, the file extension, MIME type, and human-readable description.

Signatures are checked in order, with longer/more specific signatures checked first. The match process compares each byte of the signature against the file bytes at the specified offset, optionally applying a bit mask.

The hex dump displays the first 64 bytes in traditional hex dump format: offset, hexadecimal byte values, and ASCII character representation. Non-printable characters are shown as dots.

Confidence levels: "High" means the signature match is strong and specific. Some formats share similar headers (e.g., ZIP-based formats like DOCX, XLSX, JAR), resulting in notes about possible alternatives.

Tips & Best Practices

  • 1
    Magic byte detection is more reliable than file extensions, which can be easily changed.
  • 2
    Some formats share signatures (e.g., .docx/.xlsx/.jar are all ZIP-based).
  • 3
    The hex dump helps you identify custom or unusual file formats manually.
  • 4
    Only the first 512 bytes are read โ€” the file is not fully loaded into memory.

Related Tools

Frequently Asked Questions

Q How many formats are detected?
The tool checks against 30+ known file signatures covering images, documents, archives, audio, video, fonts, and more.
Q Is the entire file read?
No, only the first 512 bytes are read for format detection. This is fast and memory-efficient.
Q What if the format is not detected?
Unknown formats show "Unknown format" with the hex dump for manual inspection.
Q Can it detect ZIP-based formats (DOCX, XLSX)?
These formats use ZIP containers, so they are detected as ZIP. The note mentions DOCX/XLSX as possibilities.
Q Is my file uploaded?
No, all analysis happens in your browser. Only the first 512 bytes are read into memory.

About This Tool

File Format Identifier is a free online tool by FreeToolkit.ai. All processing happens directly in your browser โ€” your data never leaves your device. No registration or installation required.