Web & HTTP

MIME Type Lookup: Find the Content-Type for Any File Extension

Look up the correct MIME type (Content-Type) for any file extension. Find the right value for HTTP headers, server configuration, and APIs.

Published January 15, 2025Updated June 1, 20254 min read

Try the free online tool

Runs entirely in your browser — no signup, no uploads.

Open Tool

Every file served over HTTP should be accompanied by a `Content-Type` header that tells the browser or client what kind of content it's receiving. This value is a MIME type — a standardized string like `text/html`, `application/json`, or `image/png`. Using the wrong MIME type (or omitting it entirely) can cause browsers to mishandle content, trigger security blocks, or break downloads.

With hundreds of registered MIME types covering everything from common web formats to obscure document types, looking up the correct value for a given file extension is a common need. Is a `.webp` file `image/webp` or `image/x-webp`? What is the correct MIME type for a `.woff2` font? Should you use `application/javascript` or `text/javascript` for JS files?

This tool provides an instant lookup — enter a file extension or MIME type and get the correct, standards-compliant value with notes on browser support and usage.

What Is a MIME Type?

MIME stands for Multipurpose Internet Mail Extensions. Originally defined for email, MIME types were adopted by HTTP to identify the format of data being transferred. A MIME type consists of a type and a subtype, separated by a slash: `type/subtype`. For example, `text/html` means the type is text and the subtype is HTML.

The main MIME type categories are: `text` (human-readable text), `image` (image files), `audio`, `video`, `application` (binary or application-specific data), `font`, `model`, and `multipart` (multiple independent data types). Each has many subtypes.

MIME types are used in HTTP `Content-Type` response headers, `Accept` request headers (telling the server what formats the client accepts), HTML form `enctype` attributes, and file upload handling. Servers configure MIME types for static file serving, and APIs set the Content-Type of their response bodies.

How to Use This Tool

Look up MIME types by extension or search by type name.

  1. 1

    Enter a file extension

    Type a file extension (e.g., `.pdf`, `.svg`, `.woff2`) into the search box to find its MIME type.

  2. 2

    Or search by MIME type

    Enter a MIME type string (e.g., `application/json`) to find what file extensions it corresponds to.

  3. 3

    Review the result

    The tool displays the standard MIME type, any common aliases or deprecated variants, and notes on browser or server support.

  4. 4

    Check for parameters

    Some MIME types include optional parameters, such as `text/html; charset=UTF-8`. The tool notes when a charset parameter is recommended.

  5. 5

    Copy for use

    Copy the MIME type value to paste into your web server configuration, HTTP response header, or API code.

Common Use Cases

MIME type lookup is needed in many web development and server configuration scenarios.

  • Configuring web server MIME types — adding missing MIME type mappings in nginx, Apache, or IIS for new file formats like `.webp` or `.avif`.
  • Setting Content-Type headers in APIs — ensuring API responses include the correct MIME type for JSON, XML, or custom binary formats.
  • Handling file uploads — validating the MIME type of uploaded files on the server to accept or reject them based on file type.
  • Serving downloadable files — setting the right Content-Type (and Content-Disposition) for file downloads so browsers handle them correctly.
  • Configuring CDNs and storage buckets — setting object metadata with the correct MIME type in S3, GCS, or Azure Blob Storage for proper browser handling.

Tips and Best Practices

Follow these guidelines for correct MIME type usage in web applications.

  • Always set the Content-Type header on API responses — omitting it causes browsers to sniff the content type, which can lead to security vulnerabilities.
  • For text-based MIME types, include the charset parameter: `Content-Type: text/html; charset=UTF-8` to prevent character encoding issues.
  • Use `application/octet-stream` as a fallback MIME type for unknown binary files to trigger browser download behavior.
  • Validate uploaded file MIME types on the server, not just client-side — MIME types in HTTP requests can be spoofed, so also inspect file content (magic bytes) for security.
  • Use the registered IANA MIME type, not legacy or vendor-specific aliases, for best cross-platform compatibility.

Frequently Asked Questions

What is the MIME type for JSON?

`application/json` is the standard MIME type for JSON data, as defined in RFC 8259. The older `text/json` variant is deprecated and should not be used. Always use `application/json` for REST API responses.

What MIME type should I use for JavaScript files?

The current standard is `text/javascript` as of RFC 9239, which deprecated the previously common `application/javascript`. Both are widely supported, but `text/javascript` is now the recommended value.

What is application/octet-stream used for?

`application/octet-stream` is the generic MIME type for arbitrary binary data. Browsers respond to this type by offering a file download rather than attempting to display the content. Use it when serving files with no other appropriate MIME type.

Can a MIME type have parameters?

Yes. MIME types can include parameters after a semicolon: `text/html; charset=UTF-8` or `multipart/form-data; boundary=----XYZ`. The `charset` parameter is especially important for text types to specify the character encoding.

What is the difference between text/xml and application/xml?

`text/xml` is intended for XML content that is human-readable text and uses the document's declared encoding. `application/xml` is used for XML that is not necessarily intended for direct human reading and allows more encoding flexibility. For most modern use cases, `application/xml` is preferred.

How do I find the MIME type of a file on my computer?

On Linux/macOS, use the `file --mime-type filename` command. On Windows, file type associations are stored in the registry. In Node.js, the `mime` or `mime-types` npm packages map extensions to MIME types. Browsers also report MIME types for uploaded files via the File API's `type` property.

mime typecontent-typehttpfileweb server

Ready to use this tool?

Free, instant, no account required. Runs entirely in your browser.

Open Tool

More Web & HTTP Guides