Extension to MIME type and back, with magic bytes and the header to send
Runs in your browser. Nothing you type is sent anywhere. Updated on 24 Oct 2026.A MIME type tells a browser what a file is, and getting it wrong means a download where a page should be. Look up an extension or go the other way, with the magic bytes and the header to send. The first 4 bytes identify most formats whatever the name says.
Type an extension, a file name or a media type such as application/json into the search box.
Select a row in the Types list to see its extensions, magic bytes and where it is registered.
Set the charset chips, Force a download or Add nosniff to shape the header shown above the facts.
Press Copy type for the media type alone, or Copy header for the full header lines.
This MIME types lookup works in both directions. Give it an extension, a whole file name or a media type, and it returns the canonical type to send, the extensions that belong to it, the other spellings you will meet, the magic bytes at the start of the file, and whether the content is text or binary.
The part most lists skip is the charset. A type either defines a charset parameter, in which case leaving it out makes browsers guess and mangle anything outside ASCII, or it does not. text/html, text/css, text/csv and image/svg+xml want "; charset=utf-8". application/json does not: RFC 8259 fixes JSON as UTF-8 and registers no charset parameter at all. Binary types never take one. Each row says which case it is and why.
Extensions are not unique, and the tool does not pretend otherwise. A .ts file is TypeScript to your editor and an MPEG transport stream to a video player. DOCX, XLSX, PPTX, EPUB, ODT and APK all begin with the same four zip bytes, so a signature check alone cannot separate them.
The formats this site already processes are read from its shared format table, so a signature added there appears here too. Everything else, from certificates to subtitles to installers, is listed in this tool's own table with the specification that registers it, or an honest note that nothing does. It all runs in your browser; nothing is looked up over the network.
application/json. Do not add a charset parameter: RFC 8259 section 11 defines JSON text as UTF-8 and registers no charset parameter for the type. Some servers still send text/json or application/x-json; both work in practice but neither is the registered spelling.
Add it to types that define the parameter and are read as characters: text/html, text/css, text/plain, text/csv, text/javascript and image/svg+xml. Leave it off types whose registration already fixes UTF-8, such as application/json, and off every binary type, where it means nothing.
Nothing, in practice. MIME type is the older name, from the email standard the idea came from. The registry IANA keeps is called the Media Types registry, and the HTTP specification says media type. The same string, text/html, is meant by both.
Read the first bytes. A PNG starts 89 50 4E 47 0D 0A 1A 0A, a PDF starts %PDF, a zip starts 50 4B 03 04. This page shows those signatures and their offset. Note that DOCX, XLSX, EPUB, ODT, JAR and APK all share the zip signature, so you have to look inside to tell them apart.
application/octet-stream. It is the honest answer for bytes you cannot identify, and browsers download it rather than trying to display it. Do not use it for files you can identify, because it stops images rendering, scripts running and fonts loading.
Usually the server sent application/octet-stream because its type map has no entry for the extension, or it sent Content-Disposition: attachment. Look up the right type here, add it to your server configuration, and drop the attachment header if you want the file shown in the page.
Still stuck? Ask about MIME Types and anybody who knows can answer. No account needed.
Same job, other tools: File to C Array – Turn any file into an unsigned char array for C or C++, like xxd -i · JSON to JSONL Converter – Turn a JSON array into JSON Lines, one record per line, for BigQuery or Elasticsearch · JSONL to JSON Converter – Turn JSON Lines or NDJSON into one JSON array, keeping big numbers exact · JSON Minifier – Strip whitespace from JSON for production · JSON Validator – Check JSON and see exactly where it breaks.
On the related tools: GraphQL Validator – Check a GraphQL query or schema for errors, optionally against your own SDL.
Also works as: MIME Type Lookup.
In the collection Debug and Inspect.