← All projects
Everyday tools

Magika

Uses a small AI model to work out what kind of file something really is, in milliseconds.

Widely used

What it does

A file's name doesn't always tell you what's inside it. Magika looks at a file's contents and uses a small AI model to identify its type, such as a PDF, an image, a spreadsheet or a programming language, across more than 200 kinds of content.

Its makers say it is very accurate and takes only a few milliseconds per file on an ordinary computer. When it isn't sure, it gives a general answer instead of guessing.

Google says it uses Magika to route files in Gmail, Drive and Safe Browsing to the right security checks. It comes as a command-line tool and as libraries for Python, JavaScript and other languages.

Who it's for

Security teams and developers who need to identify files reliably, and anyone curious to try the browser demo.

Can I use it without coding?

With some setup. A browser demo needs no installation; the full tool installs with one command and runs in the terminal. New to this? Start here.

Can I run it?

Cost
FreeNothing to pay or sign up for.
Runs on
Mac, Linux, Windows, Web browser
Computer
An ordinary computer is fine
Privacy
Runs on your own device: your data stays with you
API key
Not needed

Try it

  1. Try the web demo, which runs in your browser without installing anything.
  2. Or install the command-line tool and point it at files to see what type they really are.

Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?

Before you install

  • Only download from the official GitHub page. Copies with similar names exist for many popular projects.
  • License (Apache-2.0): Permissive: free to use, change and share, including for business.
  • More on staying safe