Turn a file extension into the media type a server should send for it
Runs in your browser. Nothing you type is sent anywhere. Updated on 24 Oct 2026.Servers map extensions to types from a list, and when the list is missing an entry the file arrives as application/octet-stream and the browser downloads it instead of showing it. Paste the extension here to get the type to add. Where an extension is shared, such as .ts for both TypeScript and an MPEG transport stream, you get both answers and a note on how to tell them apart.
Open the page with .docx already looked up as an example.
Type your extension, such as pdf, csv or zip, in the search box.
Where an extension is shared, such as .ts, read both rows in the Types list.
Read the Magic bytes to confirm a file really is that format.
Press Copy type and add it to your server's type list.
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 rest of the article, and all 6 questions about MIME Types, are on the MIME Types page.
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.
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.
On the related tools: GraphQL Validator – Check a GraphQL query or schema for errors, optionally against your own SDL · Markdown to HTML – Convert Markdown into clean, safe HTML you can paste anywhere.
In the collection Debug and Inspect.