FILE Magic Number Analyzer

Binary File Header Analyzer

Analyze hexadecimal file header bytes and identify common binary file signatures or magic numbers. View the detected file type, header bytes, ASCII characters and binary representation.

Magic Number File Signature Header Bytes Binary View ASCII View
File Header Analysis Hex Header Input
Paste the first bytes of a file in hexadecimal. Spaces, commas, hyphens and 0x prefixes are accepted.
The analyzer compares the beginning of the entered byte sequence with a built-in set of common file signatures. A signature match can suggest a file format, but it does not fully validate the entire file.
File Header Result
Detected Format
Typical Extension
Bytes Entered
Signature Length
First Byte
Last Entered Byte
Header Bits
Signature Match
Normalized Hex Header
ASCII View
Binary Header

What Is a Binary File Header?

A binary file header is the sequence of bytes found at the beginning of a file. Many file formats use these opening bytes to store identifying information, version details, dimensions, offsets, flags or other structural data.

Some formats begin with a recognizable signature commonly called a file signature or magic number. Examining that signature can provide a quick indication of the file type even when the filename extension is missing or incorrect.

What Is a File Signature or Magic Number?

A file signature is a known byte pattern located at or near the start of a file. Software can compare those bytes against known patterns to help identify the underlying format.

PNG: 89 50 4E 47 0D 0A 1A 0A

PDF: 25 50 44 46

JPEG: FF D8 FF

The signature does not necessarily describe every property of the file. It primarily acts as a recognizable format marker.

How the Binary File Header Analyzer Works

Paste the opening hexadecimal bytes of a file into the analyzer. The tool normalizes the byte sequence and compares its beginning with a list of known signatures.

It then displays the likely format, common extension, hexadecimal header, binary bytes and printable ASCII characters.

Input: 89 50 4E 47 0D 0A 1A 0A

Detected: PNG image

Common File Header Signatures

Format Header Signature Typical Extension
PNG 89 50 4E 47 0D 0A 1A 0A .png
JPEG FF D8 FF .jpg / .jpeg
GIF87a 47 49 46 38 37 61 .gif
GIF89a 47 49 46 38 39 61 .gif
PDF 25 50 44 46 .pdf
ZIP 50 4B 03 04 .zip
ELF 7F 45 4C 46 Various
Windows PE / EXE 4D 5A .exe / .dll
BMP 42 4D .bmp
GZIP 1F 8B .gz

PNG File Header Example

A PNG file begins with an eight-byte signature:

89 50 4E 47 0D 0A 1A 0A

Some of the bytes map to printable ASCII:

50 = P
4E = N
47 = G

That recognizable sequence is one reason file-header analysis is useful when validating an unknown binary file.

PDF Header Example

A PDF document conventionally begins with the bytes:

25 50 44 46

In ASCII these bytes correspond to:

%PDF

Additional bytes often follow with version information, but this tool focuses only on signature-level identification.

JPEG Header Example

JPEG files commonly begin with:

FF D8 FF

Different JPEG application markers may follow, so the analyzer identifies the common initial JPEG signature without trying to parse the full JPEG segment structure.

ZIP Header and ZIP-Based Formats

A common ZIP local-file header begins with:

50 4B 03 04

Several modern document formats are ZIP-based containers, so a ZIP signature alone does not always tell you the final application-level document type.

For example, a container can require deeper internal inspection before distinguishing one ZIP-based format from another. This analyzer therefore reports the direct signature rather than guessing beyond the bytes supplied.

Windows Executable Header

Many Windows executable files begin with the two-byte DOS header signature:

4D 5A

Those hexadecimal bytes correspond to the ASCII characters M and Z. Detecting this header can suggest a PE-family executable or library, but proper executable validation requires parsing additional structures later in the file.

ELF File Signature

ELF files used on many Unix-like systems begin with:

7F 45 4C 46

The final three bytes correspond to ASCII ELF. Additional ELF header fields describe properties such as architecture and byte order, but those fields are outside this tool’s signature-only purpose.

Binary, Hexadecimal and ASCII Header Views

A file header can be represented in several ways. Hexadecimal is compact, binary exposes every individual bit, and ASCII makes printable text markers easier to recognize.

Hex: 50 44 46

Binary: 01010000 01000100 01000110

ASCII: PDF

Non-printable bytes are displayed as dots in the ASCII view so the byte positions remain visible.

File Extension vs File Header

A filename extension and a binary file header are different pieces of information. The extension is part of the filename, while the signature is stored inside the file data.

Item Example Location
Extension .png Filename
File Signature 89 50 4E 47… Binary file data

A renamed file can retain its original binary signature, which is why checking header bytes can be useful during troubleshooting and analysis.

Why Analyze Binary File Headers?

File-header analysis is useful in software development, digital forensics, cybersecurity, reverse engineering, data recovery, debugging, file validation, protocol research and binary-format education.

It can help answer a basic question quickly: does the beginning of this byte sequence resemble a known file type?

Header Signature Detection Is Not Full Validation

A matching magic number is useful evidence, but it does not prove that the entire file is valid. A truncated, corrupted or deliberately crafted file can still begin with a legitimate signature.

Complete format validation normally requires parsing additional headers, lengths, checksums, tables, chunks or other structures defined by that particular file specification.

Binary File Header Analyzer vs Hex Dump Analyzer

These tools have different purposes.

Tool Main Purpose
Binary File Header Analyzer Identify and inspect opening header bytes
Hex Dump Analyzer Inspect a larger arbitrary sequence of hexadecimal data

This page intentionally focuses on the beginning of a file and signature identification rather than general-purpose hex inspection.

Important Binary File Header Notes

Important: this analyzer works from hexadecimal header bytes pasted into the page.

It does not upload or read the user’s actual file.

A detected signature indicates that the supplied bytes begin like a known format; it is not complete file validation.

The built-in signature list covers common formats rather than every file format in existence.

Some file types share container signatures and require deeper analysis to distinguish them.

ASCII output displays printable bytes and represents non-printable bytes with a dot.

This page does not calculate entropy, parse the entire binary structure, extract metadata, repair files or perform malware analysis.

Binary File Header Analyzer FAQs

What does the Binary File Header Analyzer do?
It examines pasted hexadecimal header bytes and compares their beginning with common file signatures or magic numbers.
What is a file magic number?
A magic number is a recognizable byte sequence associated with a particular file format, often located at the beginning of the file.
What is the PNG file signature?
The standard PNG signature begins with 89 50 4E 47 0D 0A 1A 0A.
What is the PDF file header?
PDF files conventionally begin with hexadecimal 25 50 44 46, which corresponds to %PDF in ASCII.
What is the JPEG magic number?
JPEG files commonly begin with FF D8 FF.
Can a file header identify a renamed file?
It can help because renaming the filename extension does not automatically change the binary bytes stored at the start of the file.
Does a matching signature prove the file is valid?
No. A signature match is only an identification clue. Full validation requires checking the rest of the file structure.
Can I upload a file directly to this tool?
This version intentionally accepts pasted hexadecimal header bytes rather than file uploads, keeping the tool lightweight and browser-friendly.
Is this the same as a hex dump analyzer?
No. This tool focuses specifically on file-header signatures, while a hex dump analyzer is intended for broader byte-sequence inspection.
Scroll to Top