MIME Type Lookup — Content-Type by File Extension

Find the correct Content-Type for any file extension, with the gotchas that break uploads — image/jpeg for .jpg, image/svg+xml for .svg. Free and searchable.

🔒 100% Client-Side Processing

Your data is processed entirely in your browser and never transmitted to any server.

Example

Input

.svg

Output

image/svg+xml

Not image/svg, which is not a registered type. Browsers refuse to render an SVG in an <img> tag unless the Content-Type matches exactly, and download it instead.

31 of 31 types

  • .jsonapplication/json

    No charset parameter — JSON is always UTF-8 by RFC 8259.

  • .htmltext/html

    Send with charset=utf-8 or the browser guesses the encoding.

  • .csstext/css
  • .jstext/javascript

    WHATWG-preferred; application/javascript is the older RFC 4329 form and still widely served.

  • .mjstext/javascript

    Same type as .js — the extension signals an ES module to bundlers, not to the browser.

  • .txttext/plain
  • .csvtext/csv
  • .xmlapplication/xml

    text/xml also valid; application/xml is preferred for machine-to-machine.

  • .pdfapplication/pdf
  • .zipapplication/zip
  • .gzapplication/gzip
  • .pngimage/png
  • .jpgimage/jpeg

    Note the type is "jpeg" even when the extension is .jpg.

  • .gifimage/gif
  • .svgimage/svg+xml

    Not image/svg. SVG is XML, and the +xml suffix matters to strict parsers.

  • .webpimage/webp
  • .avifimage/avif
  • .icoimage/vnd.microsoft.icon

    image/x-icon is the older de-facto type, still accepted everywhere.

  • .woff2font/woff2
  • .wofffont/woff
  • .ttffont/ttf
  • .mp4video/mp4
  • .webmvideo/webm
  • .mp3audio/mpeg

    Not audio/mp3 — the registered type is audio/mpeg.

  • .wavaudio/wav
  • .wasmapplication/wasm

    Must be exact — streaming compilation refuses any other type.

  • .mdtext/markdown
  • .yamlapplication/yaml

    Registered in 2024 (RFC 9512); text/yaml is the older informal type.

  • .formapplication/x-www-form-urlencoded

    Default for HTML form POSTs without enctype.

  • .multipartmultipart/form-data

    Required for file uploads; the boundary parameter is mandatory.

  • .binapplication/octet-stream

    The generic fallback. Browsers download rather than render it.

Common Use Cases

Fixing a file that downloads instead of rendering

A PDF or SVG that downloads rather than displaying almost always has the wrong Content-Type; find the right one here.

Configuring a static file server

Set correct types for fonts, WebAssembly and modern image formats, where a wrong value silently breaks loading rather than erroring.

Debugging a 415 on upload

Check what the endpoint expects against what you are sending, including the multipart boundary that must not be set by hand.

Frequently Asked Questions

Why does my SVG not render when I serve it?
Almost always the Content-Type. SVG must be served as image/svg+xml — not image/svg, which is not a registered type, and not text/xml or application/octet-stream. Browsers refuse to render an SVG in an <img> tag unless the type is exactly right, and will download it instead. The +xml suffix is part of the type, not decoration.
Should I use text/javascript or application/javascript?
text/javascript. RFC 4329 once marked it obsolete in favour of application/javascript, but the WHATWG then standardised text/javascript as the preferred type and that is what browsers and the HTML spec now use. Both work in practice for scripts. The one place it matters strictly is a module worker or an import, where some servers must send a JavaScript MIME type or the browser refuses to execute it.
Why does my file upload fail with a 415?
415 Unsupported Media Type means the endpoint rejected your Content-Type. Two causes dominate: sending application/json when the API expects multipart/form-data for a file, or sending multipart/form-data without the boundary parameter, which is mandatory and normally set automatically by the HTTP client. If you set the Content-Type header by hand on a multipart upload you will usually break the boundary — leave it unset and let the client generate it.
What does application/octet-stream actually mean?
It is the deliberate "I do not know what this is" type — arbitrary bytes with no structure the recipient should assume. Browsers download rather than render it, which is why it is sometimes set on purpose to force a download. Receiving it unexpectedly usually means the server failed to detect the type, and it is worth fixing, since it prevents inline rendering of images and PDFs and disables content-specific optimisations.
Is my data private when I use this tool?
Yes. This tool runs entirely in your browser using client-side JavaScript — nothing you type is transmitted to, logged by, or stored on any server. You can safely process confidential text, tokens, or code.