MIME Type Lookup

Find the right content type for any file extension.

MIME Type Lookup tool

ExtensionMIME typeNotes

About the MIME Type Lookup

When a file downloads instead of displaying, a font refuses to load or a script is blocked, the cause is often a wrong Content-Type header. This tool looks up the correct MIME type for any file extension, such as application/pdf for PDF files or image/webp for WebP images, and works in reverse from a content type to its extensions. It also gives ready-to-paste configuration snippets for Apache, nginx and Express, so you can fix the server rather than just diagnose the problem. Web developers, system administrators and anyone serving files from their own hosting will find it useful. For other server settings, see the Security Headers Generator, and for redirects, the Redirect Generator.

You can search from either end. Enter a file ending to learn its type, or enter part of a type, such as font, to see every ending associated with it. Results also explain whether the format is textual or binary, whether an encoding should be declared alongside it, and whether browsers tend to display it or save it.

For common web formats the page also writes the configuration line for Apache, nginx or Express, since knowing the right label is only useful once the server actually sends it. A font or a modern image format announced under the wrong label is usually fixed by adding that one line and reloading the server.

How to use the MIME Type Lookup

  1. Search by extension or typeEnter .webp, or simply image to see every image format.
  2. Read the detailsSee the category, whether a charset is needed and how browsers usually treat it.
  3. Copy the server settingLines for Apache, nginx and Express are generated for you.
  4. Check the notesSome formats still circulate under older, deprecated types.

MIME Type Lookup features

  • Hundreds of file extensions with their registered types
  • Lookup by extension or by content type
  • Advice on which types need a charset
  • Whether browsers show each type or download it
  • Configuration lines for Apache, nginx and Express
  • Deprecated types that are still common highlighted
  • Keeps working offline after the page loads

Common uses

  • Repairing a web font that refuses to load
  • Delivering WebP or AVIF images with the right header
  • Making a file download instead of opening, or the reverse
  • Deciding which types an upload form should accept
  • Setting up a server that hosts static files

Content types in practice: fonts and WebP images, nosniff, safe file uploads, downloads and server configuration

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Every file a web server sends carries a Content-Type header telling the browser what it is. When that header is wrong, fonts fail to load, images download instead of displaying, scripts are blocked and uploaded files become a security risk. This guide works through fixing missing types on a real server, explains the nosniff header, covers safe handling of uploaded files and download names, and lists the types most websites need.

A worked example: fonts and WebP images

A site switches its images to WebP and its fonts to WOFF2 to load faster. On an older server configuration, the images download instead of showing and the fonts fall back to a system font. The server has no type registered for these extensions, so it sends a generic type the browser will not use for images or fonts.

The fix is to register the correct types: image/webp for .webp and font/woff2 for .woff2. On Apache this is a line such as AddType font/woff2 .woff2, and on nginx an entry in the types block. After reloading the server, clear any cache in front of it, such as a CDN or Varnish, because cached responses keep the old headers until they expire or are purged.

The nosniff header

Browsers once guessed file types from their content, a behaviour called sniffing, which attackers exploited to make innocent-looking files run as scripts. The security header X-Content-Type-Options: nosniff tells browsers not to guess. With it set, a stylesheet served as plain text is ignored and a script with a non-script type is blocked. This is good for security, but it means correct types become essential rather than optional.

Handling uploaded files

When users upload files, neither the file extension nor the type reported by their browser can be trusted, because both are easy to fake. Safer systems check the file's actual content, since many formats begin with a recognisable signature: PDF files start with %PDF, and PNG images start with a fixed eight-byte header. Uploaded files are best served from a separate domain and, for risky types, with a header forcing download.

Download names

The Content-Disposition header controls whether a file opens in the browser or downloads, and what name it is saved under. An invoice served with Content-Disposition: attachment; filename="invoice-1042.pdf" downloads with that tidy name instead of a random string from the URL. Using inline instead of attachment asks the browser to display the file if it can.

Types most websites need

  • .html text/html and .css text/css.
  • .js and .mjs text/javascript.
  • .json application/json and .webmanifest application/manifest+json.
  • .svg image/svg+xml, .webp image/webp, .avif image/avif.
  • .woff2 font/woff2 and .pdf application/pdf.
  • .mp4 video/mp4 and .wasm application/wasm.

WebAssembly is a good example of why types matter: the fastest way of loading it in browsers only works when the file is served as application/wasm.

Office documents

Word and Excel files use long, specific types such as application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for .xlsx. Serving them with these types, rather than a generic one, helps browsers and phones choose the right app to open them. This is worth checking on sites that share forms, price lists or reports for download.

Email uses the same system

MIME stands for Multipurpose Internet Mail Extensions, because the system was designed for email attachments before it was adopted by the web. Email clients use the same types to decide how to show attachments, so a correctly typed PDF arrives as a document rather than an unknown file.

Common mistakes

  • Adding new file formats without registering their types on the server.
  • Forgetting to purge caches after fixing headers.
  • Trusting the type sent with an upload.
  • Serving user uploads from the main domain without restrictions.

Related tools

To check how browsers treat responses, see HTTP Status Codes. To add nosniff and other protective headers, use Security Headers Generator, and for server rules, .htaccess Generator.

JSON APIs

API responses containing JSON should be labelled application/json. Many client libraries parse the body automatically only when that type is present, and a response labelled as plain text or HTML has to be parsed by hand or causes errors. Clients can also send an Accept header listing the types they prefer, which lets one endpoint serve different formats when needed.

Video and audio

Video files need the right type, such as video/mp4, and the server must also support range requests, which let a player fetch only part of a file. Without range support, some browsers, notably Safari on iPhones, may refuse to play or seek through a video. Testing media on an iPhone as well as an Android phone catches these problems early.

Icons

Favicon files ending in .ico are commonly served as image/x-icon, although the officially registered type is image/vnd.microsoft.icon. Browsers accept both. Many sites now also provide PNG and SVG icons, which use the ordinary image types, so checking the types of every icon listed in the page head avoids missing icons on some devices.

Checking what your server sends

The command curl -I followed by a file's URL prints the response headers, including Content-Type. In a browser, the Network panel of the developer tools shows the same header for every file a page loads. Checking a font, an image, a script and a stylesheet after any server change confirms that types are still correct.

Privacy

Lookups run in your browser from a built-in list. Nothing you search for is sent or stored.

Frequently asked questions

Why does my file download when I wanted it to open?

Two headers decide that: the type the server declares, and whether a disposition header asks for the file to be saved. Browsers decide what to do from the type, so a PDF delivered as application/octet-stream is saved rather than displayed.

Which content types should include a charset?

Any format made of readable characters: web pages, stylesheets, scripts, data files and ordinary text documents. Without charset=utf-8 the browser may assume an older encoding and garble accented characters. Binary formats such as images and fonts never take a charset.

Is the content type decided by the file extension?

On the server, almost always, through a table that maps extensions to types. Browsers, for their part, mostly believe the label they are given and examine the bytes only occasionally, so a correct label is what really solves the problem.

What does application/octet-stream mean?

It is the generic label for unknown binary data, and a browser that receives it will download the file rather than show it. Seeing it usually means nobody has told your server what that kind of file is.

Do JavaScript modules need a particular type?

Yes. They must be served as text/javascript, because browsers refuse to run a module delivered as plain text or an unknown type. A wrong type is a frequent reason a module downloads but never executes.

Can this tool test the headers my server sends?

No, it is a reference table. To see what your server really returns, open the Network panel in your browser's developer tools, select the file and read its response headers, or use a command-line request.