Magika

Magika

โ˜… 4.2 ๐Ÿ”– 4000 saves ๐Ÿ’ฐ Free GitHub

Magika is an open-source file type detection tool from Google that replaces decades-old magic-byte heuristics with a deep learning model. With more than 18,700 stars on GitHub, it identifies over 200 content types โ€” binary and text โ€” with around 99% average precision and recall, in roughly five milliseconds per file on a single CPU. Magika already runs at Google scale, routing files for Gmail, Drive, and Safe Browsing, and it remains in active development in 2026.

Overview

Magika’s custom model was trained and evaluated on a dataset of about 100 million files and weighs only a few megabytes, exported in ONNX format for fast CPU inference. Unlike extension- or signature-based tools, it reads a small subset of a file’s content and reasons about what the file actually is, which makes it especially strong on text formats such as source code, markup, and configuration files. A per-content-type threshold system decides when to trust a prediction or fall back to a generic label, and prediction modes let callers trade confidence against coverage. Google also ships integrations used by VirusTotal and abuse.ch.

Key Features

  • Deep learning file identification across 200+ content types
  • About 99% precision and recall at roughly 5 ms per file on one CPU
  • Rust command-line tool plus Python, JavaScript/TypeScript, and Go bindings
  • Batch and recursive scanning of thousands of files at once
  • Per-type confidence thresholds with high-confidence and best-guess modes
  • Tiny few-megabyte model with near-constant inference time regardless of file size
  • Free in-browser demo that runs the model locally on your machine

๐Ÿ’ณ Pricing

Magika is completely free and open source under the Apache-2.0 license.

Who Is It For

Magika is for security teams, platform engineers, and developers who need reliable content-type detection for uploads, malware triage, content routing, or data pipelines. Its tiny footprint and millisecond latency make it practical to drop into everything from mail gateways and cloud storage scanners to desktop utilities and CI checks.

๐Ÿš€ Visit Magika Official Site

๐Ÿšฉ Report an issue