# File Type Detector (Magic Number)

Identify a file by its magic-number byte signature, not the extension. Reads the uploaded file directly across ~70 types.

> Canonical page: https://test.elysiatools.com/en/tools/file-type-detect

- **Category:** Utilities

- **Keywords:** file type, magic number, file signature, detect, identify, mime type, hex, binary, libmagic

## Overview

Identify the **true type of a file by its magic-number byte signature** — not the (easily-spoofed) filename extension.

Upload any file and the tool reads its leading bytes, then matches them against a database of ~70 magic-number signatures covering images, documents, audio, video, fonts, archives, executables and more. It reports the detected type, MIME type, recommended extension, and a **confidence score** reflecting how specific the match is.

**How it differs from magic-number-detector** — that tool takes a *hex string you type by hand* and looks it up. This tool reads the **actual uploaded file** directly, supports offset-based signatures (e.g. ZIP-relative markers at byte 4), applies bitmasks (e.g. the RIFF-size field is ignored), and surfaces confidence + all candidates when multiple signatures match.

**What it catches**
- A .png that's actually a JPEG (mismatch warning).
- An executable renamed .txt.
- A WebP hidden inside a .jpg.
- Office .docx / .xlsx (which are really ZIP containers).
- Mach-O / ELF / PE executables, Java .class, SQLite databases, fonts, etc.

**Confidence**
- ≥90%: long, anchored signature (e.g. PNG's 8-byte sequence at offset 0) — near-certain.
- 70-89%: solid match but shorter signature.
- 45-69%: ambiguous (e.g. a single leading byte like '{' for JSON).
- <45%: weak guess.

The hex dump of the first 64 bytes is always shown so you can verify the signature by hand.

## Inputs

- **File to inspect** (file): The file to identify. Only the first 512 bytes are read — large files are safe to upload.
- **Also show hex dump of first 64 bytes** (checkbox): Display the raw hex dump so you can verify the signature manually.

## When to use

- When you suspect a file extension has been altered, spoofed, or stripped entirely.
- When troubleshooting corrupted files or upload errors where a system rejects a file due to a mismatched MIME type.
- When verifying the true format of unknown binary files, executables, or archives before opening them.

## How it works

- Upload the target file; the tool safely reads only the first 512 bytes to protect performance and privacy.
- The tool compares the leading bytes and offset-based signatures against a database of ~70 magic-number signatures.
- It calculates a confidence score based on signature length and specificity, displaying the detected MIME type and recommended extension.
- Optionally, view the raw hex dump of the first 64 bytes to manually inspect the binary header.

## Use cases

- Identifying the true format of a file that has lost its extension or has an incorrect extension.
- Inspecting suspicious files or email attachments to verify if they are disguised executables.
- Debugging application upload failures by checking if a file's internal MIME type matches the expected format.

## Frequently asked questions

### How does this tool determine the file type?

It reads the file's initial bytes (magic numbers) and matches them against a database of known signatures, ignoring the file extension.

### Is it safe to upload large files?

Yes, the tool only reads the first 512 bytes of the uploaded file, making the process fast and secure even for large files.

### What does the confidence score mean?

A score of 90% or higher indicates a long, specific signature match (like PNG), while lower scores indicate shorter or more ambiguous signatures.

### Can it detect files that have been renamed?

Yes, renaming a file's extension does not change its internal byte signature, which this tool reads to identify the true format.

### How does this differ from the magic number lookup tool?

This tool analyzes an actual uploaded file directly, whereas the lookup tool requires you to manually type or paste a hex string.

## Related tools

- [Codec Artifact Detector](https://test.elysiatools.com/en/tools/audio-codec-artifact-detector): Compare an original master with its lossy encode and flag pre-echo, transient smearing, bandwidth loss and stereo damage, with per-event timestamps.
- [Podcast RSS Enclosure Checker](https://test.elysiatools.com/en/tools/audio-podcast-rss-enclosure-checker): Validate podcast episode audio against hosting expectations and cross-check it with your RSS feed: enclosure URL / length / type attributes, itunes:duration, GUID uniqueness, RFC 2822 dates, platform codecs and bitrates — byte-exact enclosure lengths included.
- [Formula / Chart Heavy PDF Analyzer](https://test.elysiatools.com/en/tools/formula-chart-heavy-pdf-analyzer): Compare local and hybrid OpenDataLoader extraction to identify PDF pages where formulas, charts, or dense visuals may need AI-assisted parsing
- [Instrument Identifier AI](https://test.elysiatools.com/en/tools/instrument-identifier-ai): Detect which instruments play in a track: onset-split note analysis scores every event against 13 timbre profiles and reports ranked instruments, families and per-note evidence.
- [Subtitle Platform Spec Checker](https://test.elysiatools.com/en/tools/subtitle-platform-spec-checker): Validate subtitles against delivery specs: Netflix Timed Text (20/17 CPS reading speed, 42 characters per line, two lines, 5/6-second minimum and 7-second maximum durations, 2-frame gaps), BBC television guidelines (37 characters per line, 160-180 wpm, 1.5-second pause gaps) and YouTube caption rules (plain UTF-8, markup not recognized) — with a per-cue findings report.
- [Train/Test Split with Stratification](https://test.elysiatools.com/en/tools/train-test-split-with-stratification): Class-stratified train/validation/test split or stratified k-fold for CSV/JSON datasets — seeded, reproducible, with distribution reports, leakage checks, SMOTE preview and CSV export.
- [Image Channel Extractor](https://test.elysiatools.com/en/tools/image-channel): Extract, manipulate, and analyze individual color channels (RGB, Alpha, Luminance) with professional processing options
- [Image Difference](https://test.elysiatools.com/en/tools/image-difference): Calculate the difference between two images to identify changes or create comparison masks

## Samples

- [Number & Currency Samples](https://test.elysiatools.com/en/samples/number-currency-samples): Text containing various number and currency formats for testing currency extraction
- [EU VAT Number Samples](https://test.elysiatools.com/en/samples/eu-vat): Collection of EU VAT numbers from all member states for validation testing
- [Global Phone Number Samples](https://test.elysiatools.com/en/samples/global-phone): Collection of phone numbers from various countries for validation testing
- [Passport Number Samples](https://test.elysiatools.com/en/samples/passport): Collection of valid passport number samples from various countries (China, USA, Japan, UK, Germany, etc.) for testing

## Related content

- [Backup Archive Restore Drill and Evidence](https://test.elysiatools.com/en/hubs/backup-archive-restore-drill-and-evidence): Plan a bounded backup restore drill, inspect a ZIP copy, recover selected files, compare trusted hashes and record application usability, timing and unresolved failures.
- [Binary Encoding, File Forensics, and Integrity Tools](https://test.elysiatools.com/en/hubs/binary-encoding-file-forensics-integrity): Inspect bytes and signatures, identify file types, measure entropy, and verify hashes or checksums in one safe forensic workflow.
