# 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://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

- [Formula / Chart Heavy PDF Analyzer](https://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
- [Train/Test Split with Stratification](https://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://elysiatools.com/en/tools/image-channel): Extract, manipulate, and analyze individual color channels (RGB, Alpha, Luminance) with professional processing options
- [Image Difference](https://elysiatools.com/en/tools/image-difference): Calculate the difference between two images to identify changes or create comparison masks
- [Image Metadata Extractor](https://elysiatools.com/en/tools/image-metadata): Extract comprehensive metadata from images including EXIF, IPTC, XMP, and technical information
- [Blood Gas Acid-Base Interpretation (AG / ΔAG)](https://elysiatools.com/en/tools/blood-gas-anion-gap): Complete ABG analysis: pH, primary disorder, compensation (Winter's formula), anion gap ± albumin correction, delta ratio for mixed disorder detection. Derived from Emmett 2016, Kraut 2007, Rastegar 2007, LITFL, MDCalc, and Adrogué 1998. Not medical advice.
- [CURB-65 vs PSI vs SMART-COP (Pneumonia Severity Comparison)](https://elysiatools.com/en/tools/curb-65-vs-pneumonia-severity): Compare three pneumonia severity scores side-by-side from one set of inputs to support concordance reading. CURB-65 (0-5: Confusion, Urea, RR, BP, age ≥65) — quick bedside triage; PSI/PORT (Fine 1997, 5 risk classes) — the most accurate mortality stratification, more complex; SMART-COP (0-10, 2 points each for SBP <90 and hypoxia, 1 point each for multilobar CXR, albumin <3.5, RR ≥25, tachycardia ≥125, confusion, pH <7.35) — predicts need for ICU respiratory/vasopressor support. Each score has a different focus: CURB-65 is fast; PSI is more precise; SMART-COP identifies who needs ICU. The tool reports each score's total/category/interpretation and an agreement analysis (whether all three point to outpatient/admission/ICU). When scores disagree, favor the more conservative disposition. Derived from Lim 2003, Fine 1997, Charles 2008. Not medical advice.
- [DNA Concentration Calculator (A260 Absorbance)](https://elysiatools.com/en/tools/dna-concentration-a260): Beer–Lambert DNA quantitation: c = A260 × dilution factor × K / path length with 1 OD = 50 µg/mL dsDNA or 33 µg/mL ssDNA, plus ng/µL, total yield, and a 0.1–1.5 linear-range check. Derived from Marmur & Doty, Sambrook & Russell, Thermo Fisher NanoDrop notes. Educational use only.

## Samples

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

## Related content

- [Binary Encoding, File Forensics, and Integrity Tools](https://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.
