Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsMIME TypesFile Extension to MIME Type

File Extension to MIME Type

dev

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.

Next:
  • HTTP Status Codes Every HTTP status code, what it means, when to send it and the RFC it comes from
  • Hex Viewer (xxd online) See any file as an xxd hex dump with offsets and text, or turn a hex dump back into a file

How to find the MIME type of a file extension

1

Open the page with .docx already looked up as an example.

2

Type your extension, such as pdf, csv or zip, in the search box.

3

Where an extension is shared, such as .ts, read both rows in the Types list.

4

Read the Magic bytes to confirm a file really is that format.

5

Press Copy type and add it to your server's type list.

How File Extension to MIME Type works

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.

Frequently asked questions

What is the MIME type for a JSON file?

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.

How do I find a file type without trusting the extension?

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.

What MIME type should I use for an unknown file?

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.

Why does my file download instead of opening in the browser?

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.

More ways to use MIME Types

  • MIME TypesExtension to MIME type and back, with magic bytes and the header to send
  • Content-Type HeaderThe exact Content-Type header to send, including when to add charset=utf-8
  • MIME Type ListA full list of common media types by group: text, image, audio, video, archive

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.

Related tools

All developer tools
Hex Viewer (xxd online)See any file as an xxd hex dump with offsets and text, or turn a hex dump back into a fileGraphQL FormatterFormat, minify and validate GraphQL queries and schemas, with errors by line and columnJSONL Viewer and ValidatorCheck JSON Lines and NDJSON line by line, view records as a table, convert to a JSON arrayJSON Formatter & ValidatorFormat, validate, minify and sort JSON with exact error positionsSQL FormatterFormat and beautify SQL for PostgreSQL, MySQL, SQL Server and moreMarkdown PreviewWrite Markdown and see it rendered live, with tables, task lists and codeHTML Formatter & MinifierIndent messy HTML, or minify it and see the bytes you savedCSS Beautifier & MinifierTidy a stylesheet or minify it, with the size saved shown

In the collection Debug and Inspect.

Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)