Skip to the tool
DevToolBench

MIME Type Lookup

Extension to media type and back, with the header to send.

an extension or a type
for the list below

Type an extension, a whole filename, a URL or a media type. The answer comes with the header you would actually write, charset included when the type is text.

In this group
120
Extensions mapped
120
Distinct types
104
Matches
0
ExtensionContent-Type
.htmltext/html
.htmtext/html
.csstext/css
.jstext/javascript
.mjstext/javascript
.cjstext/javascript
.jsonapplication/json
.jsonldapplication/ld+json
.mapapplication/json
.xmlapplication/xml
.xhtmlapplication/xhtml+xml
.txttext/plain
.mdtext/markdown
.csvtext/csv
.tsvtext/tab-separated-values
.icstext/calendar
.vcftext/vcard
.wasmapplication/wasm
.webmanifestapplication/manifest+json
.rssapplication/rss+xml
.atomapplication/atom+xml
.xslapplication/xslt+xml
.yamlapplication/yaml
.ymlapplication/yaml
.tomlapplication/toml
.sqlapplication/sql
.pngimage/png
.jpgimage/jpeg
.jpegimage/jpeg
.jpeimage/jpeg
.gifimage/gif
.webpimage/webp
.avifimage/avif
.svgimage/svg+xml
.icoimage/vnd.microsoft.icon
.bmpimage/bmp
.tifimage/tiff
.tiffimage/tiff
.heicimage/heic
.heifimage/heif
.jxlimage/jxl
.apngimage/apng
.psdimage/vnd.adobe.photoshop
.mp3audio/mpeg
.wavaudio/wav
.oggaudio/ogg
.ogaaudio/ogg
.opusaudio/ogg
.m4aaudio/mp4
.aacaudio/aac
.flacaudio/flac
.webaaudio/webm
.midaudio/midi
.midiaudio/midi
.mp4video/mp4
.m4vvideo/mp4
.webmvideo/webm
.ogvvideo/ogg
.movvideo/quicktime
.avivideo/x-msvideo
.mkvvideo/x-matroska
.mpegvideo/mpeg
.mpgvideo/mpeg
.tsvideo/mp2t
.3gpvideo/3gpp
.3g2video/3gpp2
.wofffont/woff
.woff2font/woff2
.ttffont/ttf
.otffont/otf
.ttcfont/collection
.eotapplication/vnd.ms-fontobject
.pdfapplication/pdf
.docapplication/msword
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
.xlsapplication/vnd.ms-excel
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.pptapplication/vnd.ms-powerpoint
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation
.odtapplication/vnd.oasis.opendocument.text
.odsapplication/vnd.oasis.opendocument.spreadsheet
.odpapplication/vnd.oasis.opendocument.presentation
.rtfapplication/rtf
.epubapplication/epub+zip
.mobiapplication/x-mobipocket-ebook
.texapplication/x-tex
.zipapplication/zip
.gzapplication/gzip
.tgzapplication/gzip
.tarapplication/x-tar
.bz2application/x-bzip2
.7zapplication/x-7z-compressed
.rarapplication/vnd.rar
.xzapplication/x-xz
.zstapplication/zstd
.isoapplication/x-iso9660-image
.jarapplication/java-archive
.binapplication/octet-stream
.exeapplication/vnd.microsoft.portable-executable
.msiapplication/x-msdownload
.dmgapplication/x-apple-diskimage
.debapplication/vnd.debian.binary-package
.rpmapplication/x-rpm
.apkapplication/vnd.android.package-archive
.shapplication/x-sh
.pytext/x-python
.phpapplication/x-httpd-php
.swfapplication/x-shockwave-flash
.dbapplication/vnd.sqlite3
.sqliteapplication/vnd.sqlite3
.pemapplication/x-pem-file
.crtapplication/x-x509-ca-cert
.p12application/x-pkcs12
.logtext/plain
.srtapplication/x-subrip
.vtttext/vtt
.ndjsonapplication/x-ndjson
.geojsonapplication/geo+json
.gpxapplication/gpx+xml
.kmlapplication/vnd.google-earth.kml+xml

Everything runs in your browser. Nothing you type is sent to a server.

Found a bug in this tool? Report it.

Share this tool

What a MIME type lookup answers, and what it does not

This is a two-way MIME type lookup: type an extension, a full filename or a URL and you get the media type to send, or paste a media type and you get the extensions that carry it. Every answer comes with the header as you would write it — charset included when the type is textual — plus a flag when the string you pasted is one of the obsolete names that survive in copied server configs. One hundred and twenty extensions are mapped here, chosen because they turn up on real web servers rather than because a registry lists them.

What it cannot tell you is what a file really is. A media type is a claim made by whoever served the bytes, and a .png suffix is a claim made by whoever named the file. Neither is evidence. If you need certainty about untrusted input, read the magic bytes; a lookup table is for deciding what to declare, not for verifying what arrived.

The extension is a hint, the header is the contract

On a local disk the extension does the work: it is how your operating system picks an application. Over HTTP the extension is almost irrelevant. The browser reads Content-Type, decides between rendering, downloading and handing the bytes to a decoder, and never looks at the URL to settle it.

That split explains most of the confusion. A file called report.pdf served as text/plain displays as gibberish in the tab. A file with no extension at all served as application/pdf opens in the PDF viewer. Static hosts blur the distinction because they derive the header from the extension, and then the mapping is only as good as the server's own table — which is exactly the table that goes stale.

Two extensions in this list are worth a second look. .ts maps to video/mp2t, an MPEG transport stream, so a server guessing by extension will offer your TypeScript sources to a video player. And .tgz is a double extension where only the final part decides: the type is application/gzip, because the tar archive is inside the gzip container, not beside it.

text/javascript won, and it took fifteen years

For most of the 2000s and 2010s there were three plausible types for a script: application/x-javascript, application/javascript and text/javascript. Style guides told you the text/ one was deprecated. RFC 9239, published in 2022, reversed that: text/javascript is now the registered type, and application/javascript is obsolete.

Nothing breaks either way, because browsers accept a generous list of JavaScript types. It matters anyway for two reasons. Linters and security scanners check against the registry, and nosniff refuses a script served with a type outside that accepted list — so a config that has drifted far enough will fail loudly rather than quietly.

The same tidying happened to fonts. RFC 8081 created the font/ top-level type in 2017, which is why font/woff2 is correct today and application/font-woff2 is the line still sitting in thousands of copied nginx configs.

application/octet-stream is a shrug

application/octet-stream means unknown bytes. It is a fallback, not a description, and it is what this tool returns when nothing in the table matches. Faced with it, a browser saves the file, because rendering something you have declined to identify is how vulnerabilities get written.

Seeing it in production usually means one of three things: the server has no mapping for that extension, an object storage bucket applied its default type at upload time, or a proxy stripped the original header. Setting it deliberately is reasonable for a genuine binary download. Setting it by accident is why a customer reports that your image gallery downloads files instead of showing them.

Sniffing, and the header that stops it

When a type looks wrong, browsers historically sniffed: they inspected the leading bytes and overrode the declared type. Convenient, and a security problem, because a user upload that a server declares as text/plain can be sniffed into HTML and executed against your origin.

X-Content-Type-Options: nosniff turns that off. Send it on everything, then make sure your types are right, because with sniffing disabled a wrong type stops being cosmetic. Two rules go with it for anything users upload: serve from a separate origin, and never serve user files as image/svg+xml, since SVG is markup that can carry script.

Every extension in the table

ExtensionMIME typeGroup
.htmltext/htmlWeb and text
.htmtext/htmlWeb and text
.csstext/cssWeb and text
.jstext/javascriptWeb and text
.mjstext/javascriptWeb and text
.cjstext/javascriptWeb and text
.jsonapplication/jsonWeb and text
.jsonldapplication/ld+jsonWeb and text
.mapapplication/jsonWeb and text
.xmlapplication/xmlWeb and text
.xhtmlapplication/xhtml+xmlWeb and text
.txttext/plainWeb and text
.mdtext/markdownWeb and text
.csvtext/csvWeb and text
.tsvtext/tab-separated-valuesWeb and text
.icstext/calendarWeb and text
.vcftext/vcardWeb and text
.wasmapplication/wasmWeb and text
.webmanifestapplication/manifest+jsonWeb and text
.rssapplication/rss+xmlWeb and text
.atomapplication/atom+xmlWeb and text
.xslapplication/xslt+xmlWeb and text
.yamlapplication/yamlWeb and text
.ymlapplication/yamlWeb and text
.tomlapplication/tomlWeb and text
.sqlapplication/sqlWeb and text
.pngimage/pngImages
.jpgimage/jpegImages
.jpegimage/jpegImages
.jpeimage/jpegImages
.gifimage/gifImages
.webpimage/webpImages
.avifimage/avifImages
.svgimage/svg+xmlImages
.icoimage/vnd.microsoft.iconImages
.bmpimage/bmpImages
.tifimage/tiffImages
.tiffimage/tiffImages
.heicimage/heicImages
.heifimage/heifImages
.jxlimage/jxlImages
.apngimage/apngImages
.psdimage/vnd.adobe.photoshopImages
.mp3audio/mpegAudio
.wavaudio/wavAudio
.oggaudio/oggAudio
.ogaaudio/oggAudio
.opusaudio/oggAudio
.m4aaudio/mp4Audio
.aacaudio/aacAudio
.flacaudio/flacAudio
.webaaudio/webmAudio
.midaudio/midiAudio
.midiaudio/midiAudio
.mp4video/mp4Video
.m4vvideo/mp4Video
.webmvideo/webmVideo
.ogvvideo/oggVideo
.movvideo/quicktimeVideo
.avivideo/x-msvideoVideo
.mkvvideo/x-matroskaVideo
.mpegvideo/mpegVideo
.mpgvideo/mpegVideo
.tsvideo/mp2tVideo
.3gpvideo/3gppVideo
.3g2video/3gpp2Video
.wofffont/woffFonts
.woff2font/woff2Fonts
.ttffont/ttfFonts
.otffont/otfFonts
.ttcfont/collectionFonts
.eotapplication/vnd.ms-fontobjectFonts
.pdfapplication/pdfDocuments
.docapplication/mswordDocuments
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentDocuments
.xlsapplication/vnd.ms-excelDocuments
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetDocuments
.pptapplication/vnd.ms-powerpointDocuments
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationDocuments
.odtapplication/vnd.oasis.opendocument.textDocuments
.odsapplication/vnd.oasis.opendocument.spreadsheetDocuments
.odpapplication/vnd.oasis.opendocument.presentationDocuments
.rtfapplication/rtfDocuments
.epubapplication/epub+zipDocuments
.mobiapplication/x-mobipocket-ebookDocuments
.texapplication/x-texDocuments
.zipapplication/zipArchives
.gzapplication/gzipArchives
.tgzapplication/gzipArchives
.tarapplication/x-tarArchives
.bz2application/x-bzip2Archives
.7zapplication/x-7z-compressedArchives
.rarapplication/vnd.rarArchives
.xzapplication/x-xzArchives
.zstapplication/zstdArchives
.isoapplication/x-iso9660-imageArchives
.jarapplication/java-archiveArchives
.binapplication/octet-streamEverything else
.exeapplication/vnd.microsoft.portable-executableEverything else
.msiapplication/x-msdownloadEverything else
.dmgapplication/x-apple-diskimageEverything else
.debapplication/vnd.debian.binary-packageEverything else
.rpmapplication/x-rpmEverything else
.apkapplication/vnd.android.package-archiveEverything else
.shapplication/x-shEverything else
.pytext/x-pythonEverything else
.phpapplication/x-httpd-phpEverything else
.swfapplication/x-shockwave-flashEverything else
.dbapplication/vnd.sqlite3Everything else
.sqliteapplication/vnd.sqlite3Everything else
.pemapplication/x-pem-fileEverything else
.crtapplication/x-x509-ca-certEverything else
.p12application/x-pkcs12Everything else
.logtext/plainEverything else
.srtapplication/x-subripEverything else
.vtttext/vttEverything else
.ndjsonapplication/x-ndjsonEverything else
.geojsonapplication/geo+jsonEverything else
.gpxapplication/gpx+xmlEverything else
.kmlapplication/vnd.google-earth.kml+xmlEverything else

The names that were never right

None of the strings on the left is the registered name today, and every one of them is somewhere in a configuration file being copied right now. Browsers tolerate all of them, which is precisely why they persist; the cost lands on the next person to inherit the config, and on any validator, gateway or CDN rule that matches types exactly.

WrittenRegistered todayWhy it matters
application/x-javascripttext/javascriptNever registered at all. It predates the argument and survives only in old server configs.
application/javascripttext/javascriptObsolete since RFC 9239, which settled fifteen years of disagreement in favour of text/javascript.
text/jsonapplication/jsonNever existed. JSON is UTF-8 by definition, so it never needed a text type or a charset.
text/xmlapplication/xmlValid but dangerous: without an explicit charset it defaults to US-ASCII, which quietly mangles UTF-8.
image/jpgimage/jpegThe extension lost a letter in the MS-DOS era; the media type never did.
image/x-pngimage/pngThe experimental name from before PNG was registered in 1996.
image/x-iconimage/vnd.microsoft.iconAccepted everywhere and registered nowhere. Browsers do not care; validators do.
audio/mp3audio/mpegMP3 is layer three of MPEG audio, and the registered type names the container, not the layer.
application/x-pdfapplication/pdfThe x- prefix meant unregistered, and PDF has been registered since 1993.
application/font-wofffont/woffRFC 8081 created the font top-level type in 2017 and deprecated every application/font-* name.
application/font-woff2font/woff2Same change as WOFF, and the one most often left behind in a copied nginx config.
application/x-font-ttffont/ttfSuperseded by RFC 8081 along with the rest of the x-font family.
application/x-zip-compressedapplication/zipA Windows shell invention that leaks into uploads from Explorer.
application/x-rar-compressedapplication/vnd.rarRAR was registered under the vendor tree in 2016.
application/x-gzipapplication/gzipRegistered without the prefix by RFC 6713.
text/yamlapplication/yamlYAML had no registered type until RFC 9512 in 2024; text/yaml and application/x-yaml are both improvised.
application/csvtext/csvCSV is text, and RFC 4180 registered it as such.
application/x-httpd-php-sourcetext/plainServing PHP source at all is the bug; the type is the least of it.

Where this fits

A wrong media type usually shows up first as a status code that makes no sense — a 415 on an upload, or a 406 from content negotiation — and the HTTP status codes reference says what each of those is really complaining about. When the argument is about the path that produced the header rather than the header itself, the URL parser splits a request target into the pieces the server matches on. And when a type arrives attached to an inline payload, the Base64 encoder and decoder is the quickest way to see what a data: URI is actually carrying.

The table above is compiled into this page, so the lookup works with the network off. Your input never leaves the tab.

Frequently asked questions

What is the MIME type for JSON?

application/json, and it takes no charset parameter. The JSON specification fixes the encoding at UTF-8, so there is nothing for a charset to disagree with; writing application/json; charset=utf-8 is harmless but redundant, and text/json was never registered at all. The variants with a structured suffix follow the same rule: application/ld+json for JSON-LD, application/geo+json for GeoJSON, application/manifest+json for a web app manifest. Newline-delimited JSON is the odd one out, still unregistered and usually served as application/x-ndjson.

Is it image/jpg or image/jpeg?

image/jpeg, always. The three-letter .jpg extension is a leftover from MS-DOS filenames, which allowed no more than three characters after the dot; the media type never lost the fourth letter. image/jpg is the single most common invented type on the web — browsers forgive it because they sniff the first bytes anyway, but a strict upload validator, an email gateway or a CDN rule matching on exact type will not. Accept it on input if you must, and never emit it.

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

Almost always because the server sent application/octet-stream. That type means the server has no idea what the bytes are, and a browser handed unknown bytes has one safe option, which is to save them. The usual cause is a server with no mapping for that extension, or a storage bucket that defaults every object to octet-stream on upload. Fix it where the file is served, not in the page requesting it, and check the Content-Disposition header too, since an attachment value forces a download whatever the type says.

Do I need a charset on every Content-Type header?

Only on textual types, and there it matters more than people expect. text/html, text/css, text/plain and text/csv all have historical defaults that are not UTF-8, so a missing charset can leave a document decoded as ISO-8859-1 and every accented character rendered as two symbols. Binary types take no charset, and application/json does not need one. The rule that costs you nothing to follow is: if the file is something you could open in an editor and read, add charset=utf-8.

What does X-Content-Type-Options nosniff actually do?

It tells the browser to trust your Content-Type instead of inspecting the bytes. Without it, a browser may decide that a file you declared as text/plain looks like HTML and treat it as HTML, which turns any endpoint that echoes user content into a scripting hole. With nosniff, a stylesheet that is not served as text/css is refused and a script that is not served as a JavaScript type is refused, so the header also turns silent misconfiguration into a visible error in the console.

Related tools

Updated