# google/magika

Fast and accurate AI powered file content types detection

Repository: https://github.com/google/magika
Canonical: https://ross.abutalabs.com/products/magika
Homepage: https://securityresearch.google/magika/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: deep-learning, filetype, keras-classification-models, keras-models, mime-types, ai, onnx
Last push: 2026-08-21T18:20:00+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 81, longevity 79
- inputs: {"age_days": 1107, "days_push": 12, "days_rel": 131, "gap_med": 20, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 17971, forks 1120 (observed 2026-08-28T04:11:20.637690+00:00)

## What it is
Magika is an AI-powered file content type detection tool that uses a small, highly optimized deep learning model to identify 200+ file types within milliseconds on a single CPU. It is available as a Rust-based CLI, a Python package, and bindings for JavaScript/TypeScript, Rust, and Go.

## Use cases
- detect the content type of a file
- identify mime type of uploaded files
- detect file type from bytes instead of extension
- scan directories to classify thousands of files
- route files to security scanners based on content type
- detect file types in the browser or nodejs

## When to choose
- you need fast, accurate file type detection beyond simple extension or magic-byte checks
- you need to process large volumes of files at scale
- you need bindings across Python, Rust, JavaScript, or Go
- you need accurate detection of textual content types like source code

## When to avoid
- you need to detect obscure file types outside its 200+ supported content types
- you cannot tolerate a small ML model dependency in a minimal environment
- you only need basic magic-number checks that libmagic already covers

## Facets
- artifact type: cli-tool
- maturity: stable
- function: machine-learning, deep-learning, developer-tools, security
- domain: security, machine-learning, developer-tools, files
- platform: cross-platform, cli, python, rust, browser, wasm
- tags: file-type-detection, mime-type, onnx, content-type, file-identification, nodejs

## Member repositories
- google/magika (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:20.637690+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:02:12.003949+00:00, confidence not recorded.
  - readme: https://github.com/google/magika (fetched 2026-08-28T04:11:20.637690+00:00, sha 041077b127ff)
  - homepage: https://securityresearch.google/magika/ (fetched 2026-08-29T08:00:23.854081+00:00, sha ec15d30f9bd5)
  - site_page: https://securityresearch.google/magika/getting-started/installation (fetched 2026-08-29T08:00:23.863788+00:00, sha 19af51b62f71)
  - site_page: https://securityresearch.google/magika/getting-started/quick-start (fetched 2026-08-29T08:00:23.866241+00:00, sha 0b720bd7d2ac)
  - registry_pypi: https://pypi.org/pypi/magika/json (fetched 2026-08-29T08:00:23.872983+00:00, sha 1860273316e6)
  - site_page: https://securityresearch.google/magika/additional-resources/faq (fetched 2026-08-29T08:00:23.868689+00:00, sha 31f6373ff4e3)
  - site_page: https://securityresearch.google/magika/additional-resources/changelog (fetched 2026-08-29T08:00:23.870903+00:00, sha 03a7d6528fb4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
