Back to blog
GuidesJun 13, 2026

Identify File Type by Magic Number Signature

Discover how to accurately identify any file's true format using its magic number signature with AllToools' free online File Type Identifier. This guide explains the process and its benefits.

Sometimes a file's extension doesn't tell the whole story, or it might be missing entirely. This can happen with corrupted downloads, incorrectly renamed files, or when dealing with data archives. Fortunately, there's a reliable way to determine a file's actual format: by examining its unique magic number signature. AllToools offers a simple, browser-based utility to help you identify file types quickly and privately.

Quick answer: Inspect the first few bytes of a file to find its magic number signature, then use an online tool like AllToools' File Type Identifier to match this signature against a database of known file formats. This reveals the file's true type, regardless of its extension.

Purpose: What is a Magic Number and Who Needs to Know?

A file's magic number is a sequence of bytes found at the very beginning of the file that acts as an internal identifier for its format. Think of it as a hidden file extension that the operating system or application can read to understand what kind of data is inside. File extensions, like .txt, .jpg, or .pdf, are just labels that can be easily changed or removed, leading to confusion.

Knowing how to identify a file by its magic number is crucial for various scenarios. This includes troubleshooting issues with corrupted or unreadable files, verifying the authenticity of downloaded files, recovering data from misnamed archives, or simply understanding the true nature of an unfamiliar file. Anyone who regularly handles diverse file types, works with data recovery, or needs to ensure file integrity can benefit from this method.

How to Use the File Type Identifier Tool

Using AllToools' File Type Identifier is straightforward and requires no software installation or file uploads. The process leverages the magic number signature to pinpoint the file's format directly within your browser.

  • Visit the File Type Identifier tool page on AllToools.
  • You will see a field where you can paste the magic number or a hexadecimal representation of the initial bytes of your file.
  • If directly pasting bytes is difficult, you can extract the first 16-32 bytes of your file using command-line tools or a hex editor and then paste them into the tool.
  • Paste the extracted byte sequence (usually in hexadecimal format, often separated by spaces) into the provided input field.
  • Click the 'Identify' or equivalent button.
  • The tool will analyze the signature and display the identified file type.

Real-World Scenarios for Identifying File Types

Understanding a file's true format can solve several practical problems:

  • Troubleshooting Corrupted Downloads: You downloaded a file, but its extension is unusual or missing, and it won't open. By checking its magic number, you might discover it's actually a valid JPEG or PDF, meaning the download might be incomplete rather than the file being corrupted.
  • Identifying Suspicious Files: If you receive a file with an unexpected extension (e.g., a .exe file disguised as a .jpg), examining its magic number can reveal if it's genuinely an executable or if the extension has been deliberately spoofed.
  • Recovering Data from Misnamed Files: You have a file with no extension, or an incorrect one, and you suspect it's a specific archive type like a ZIP or RAR file. The magic number can confirm its actual format, allowing you to rename it correctly and extract its contents.
  • Verifying File Authenticity: When receiving files from untrusted sources, checking the magic number against the claimed file extension can be a quick way to spot potential tampering or misrepresentation.
  • Working with Unknown Data: In digital forensics or data analysis, encountering files with unknown origins is common. Magic numbers provide a robust starting point for classification.

Specifics and Limitations

The File Type Identifier tool is highly effective but has certain characteristics and limitations to be aware of:

  • Supported File Types: The tool can identify a wide range of common file types based on their standard magic numbers. This includes images (JPEG, PNG, GIF), documents (PDF, DOCX), archives (ZIP, RAR), executables (EXE), and many more. A comprehensive list is usually available on the tool's page.
  • Browser-Based Processing: All analysis happens within your web browser. This means no files are uploaded to any server, ensuring your data remains private and secure. However, the amount of data your browser can handle for analysis depends on your computer's memory and browser performance, especially for very large files. For this tool, you typically only need the first few bytes, making it suitable even for large files.
  • Extracting Magic Numbers: To get the magic number, you usually need to look at the first few bytes (e.g., 4-16 bytes) of a file. On Linux/macOS, you can use the `head -c 16 yourfile` command followed by `xxd` or `hexdump` to view it in hexadecimal. On Windows, you can use PowerShell (`Get-Content yourfile -Encoding Byte -TotalCount 16 | Format-Hex`) or a hex editor.
  • No File Repair or Decryption: This tool identifies the file's format. It cannot repair corrupted files, decrypt password-protected files, or reverse file damage. If a file is truly corrupted, identifying it as a PDF won't make it readable.
  • Incomplete or Modified Signatures: While rare, some files might have truncated or altered magic numbers, which could lead to misidentification or failure to identify the type.

Frequently Asked Questions

How do I find out what kind of file I have?

To find out what kind of file you have, look at its file extension (e.g., .pdf, .jpg). If the extension is missing, incorrect, or misleading, you can inspect the first few bytes of the file to find its magic number signature. This unique sequence of hexadecimal characters identifies the true file format, which can then be looked up using a tool like AllToools' File Type Identifier.

What is a file's magic number and how do I read it?

A file's magic number is a sequence of bytes at the beginning of the file that explicitly states its type. For example, a PDF file typically starts with %PDF. When viewed in hexadecimal, this sequence might look like `25 50 44 46`. You read it by extracting the initial bytes of the file and comparing them to known signatures for various file formats.

How can I identify a file extension if it's missing or wrong?

If a file extension is missing or incorrect, you can use the file's magic number signature to identify its true format. Extract the first few bytes of the file, convert them to hexadecimal if necessary, and then use an online file type identifier tool. The tool will match the signature to a known file type, allowing you to assign the correct extension.

What's the best way to check the real format of a downloaded file?

The best way to check the real format of a downloaded file is to examine its magic number signature. This hidden identifier at the start of the file is more reliable than its extension. Use a tool like the AllToools File Type Identifier, paste the hexadecimal representation of the first few bytes, and it will tell you the actual file type, even if the extension is misleading.

Can I determine a file's type without uploading it online?

Yes, you can determine a file's type without uploading the entire file. Many tools, including AllToools' File Type Identifier, work by analyzing only the first few bytes (the magic number) of a file. You can extract these bytes locally on your computer and then paste that snippet into the online tool, keeping your sensitive data private.

Common File Signatures to Recognize

While the File Type Identifier tool handles the lookup for you, understanding some common magic numbers can be helpful:

  • PDF: `%PDF` (Hex: `25 50 44 46`)
  • JPEG: `FF D8 FF` (Hex: `FF D8 FF`)
  • PNG: `89 50 4E 47 0D 0A 1A 0A` (Hex: `89 50 4E 47 0D 0A 1A 0A`)
  • ZIP: `50 4B 03 04` (Hex: `50 4B 03 04`)
  • GIF: `47 49 46 38 37 61` or `47 49 46 38 39 61` (Hex: `47 49 46 38 37 61` / `47 49 46 38 39 61`)
  • Microsoft Word (.doc): `D0 CF 11 E0 A1 B1 1A E1` (Hex: `D0 CF 11 E0 A1 B1 1A E1`)
  • Microsoft Excel (.xls): `D0 CF 11 E0 A1 B1 1A E1` (Hex: `D0 CF 11 E0 A1 B1 1A E1`) - Note: Older Office formats share signatures.

When using the tool, pasting these hex sequences (often with spaces) will help it identify the file type accurately.

Try the File Type Identifier now

Try the File Type Identifier tool

Free, browser-based, no signup. Open it and get the job done in seconds.

Open File Type Identifier
View all