ModernCalcs

MIME Type Finder

Look up the MIME type for a file extension, or search by MIME type to find matching extensions.

ExtensionMIME TypeCategory
.txttext/plainText
.htmltext/htmlText
.htmtext/htmlText
.csstext/cssText
.csvtext/csvText
.mdtext/markdownText
.xmlapplication/xmlText
.jstext/javascriptCode
.mjstext/javascriptCode
.tsvideo/mp2tCode
.jsonapplication/jsonCode
.jsonldapplication/ld+jsonCode
.yamlapplication/yamlCode
.ymlapplication/yamlCode
.tomlapplication/tomlCode
.pytext/x-pythonCode
.javatext/x-java-sourceCode
.ctext/x-csrcCode
.phpapplication/x-httpd-phpCode
.shapplication/x-shCode
.sqlapplication/sqlCode
.jpgimage/jpegImage
.jpegimage/jpegImage
.pngimage/pngImage
.gifimage/gifImage
.webpimage/webpImage
.svgimage/svg+xmlImage
.icoimage/vnd.microsoft.iconImage
.bmpimage/bmpImage
.tiffimage/tiffImage
.avifimage/avifImage
.heicimage/heicImage
.mp3audio/mpegAudio
.wavaudio/wavAudio
.oggaudio/oggAudio
.m4aaudio/mp4Audio
.flacaudio/flacAudio
.mp4video/mp4Video
.webmvideo/webmVideo
.avivideo/x-msvideoVideo
.movvideo/quicktimeVideo
.mkvvideo/x-matroskaVideo
.pdfapplication/pdfDocument
.docapplication/mswordDocument
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentDocument
.xlsapplication/vnd.ms-excelDocument
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetDocument
.pptapplication/vnd.ms-powerpointDocument
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentationDocument
.rtfapplication/rtfDocument
.zipapplication/zipArchive
.rarapplication/vnd.rarArchive
.7zapplication/x-7z-compressedArchive
.tarapplication/x-tarArchive
.gzapplication/gzipArchive
.wofffont/woffFont
.woff2font/woff2Font
.ttffont/ttfFont
.otffont/otfFont
.eotapplication/vnd.ms-fontobjectFont
.exeapplication/x-msdownloadBinary
.binapplication/octet-streamBinary
.wasmapplication/wasmBinary
.apkapplication/vnd.android.package-archiveBinary
.dmgapplication/x-apple-diskimageBinary
.isoapplication/x-iso9660-imageBinary
66 of 66 entries shown

MIME Type Finder: File Extensions to Content-Type Reference

Setting the wrong Content-Type header is a common source of bugs — a file that downloads instead of previewing, an upload validator that rejects a valid file, or an API response a browser refuses to parse. This searchable reference maps common file extensions to their correct MIME type, organized by category.

Formula
Extension -> MIME Type -> Content-Type Header

Example: .png -> image/png -> Content-Type: image/png

MIME Types and the Content-Type Header

When a server responds to a request, the Content-Type HTTP header tells the browser what kind of data follows, using the MIME type as its value. Getting this wrong is why you sometimes see a PDF try to download as plain text, or an image render as a wall of binary garbage in the browser.

Choosing Between Similar Types

Some file kinds have more than one type in circulation — .js files have historically used both application/javascript and text/javascript, for instance. This reference lists the modern, widely-recommended type for each extension so you're not guessing between legacy options.

Validating Uploads by MIME Type

Server-side upload validation often checks the MIME type reported by the browser (or better, sniffs the file's actual magic bytes) against an allowlist. Knowing the exact expected type — image/jpeg vs. image/jpg (which isn't standard) — avoids rejecting valid files due to a typo in your allowlist.

Practical Examples

Setting a Download Header Correctly

Serving a generated PDF report.

  • 1.File: report.pdf
  • 2.MIME Type: application/pdf
  • 3.Header: Content-Type: application/pdf

Validating an Image Upload

Restricting uploads to common image formats.

  • 1.Allowlist: image/png, image/jpeg, image/webp
  • 2.Uploaded file: photo.webp
  • 3.Check: image/webp is in the allowlist -> accept

Categories Covered

  • Text & Code: txt, html, css, js, json, py, sql
  • Images: jpg, png, gif, webp, svg, avif, heic
  • Audio & Video: mp3, wav, mp4, webm, mov
  • Documents: pdf, docx, xlsx, pptx
  • Archives & Fonts: zip, tar, woff2, ttf

Where MIME Types Matter Most

  • Setting Content-Type on API and file-serving responses
  • Validating file uploads server-side
  • Configuring CORS and Content-Security-Policy rules by resource type
  • Building download links with the correct 'type' attribute

Frequently Asked Questions

What is a MIME type?

A MIME type (also called a media type or Content-Type) tells a browser or application what kind of data a file contains — for example, image/png for a PNG image or application/json for JSON data — so it knows how to handle or render it.

Why does the MIME type matter for file uploads?

Servers and browsers use the Content-Type header to decide how to process a file — whether to render it inline, force a download, or validate that an upload matches an expected file type. Setting the wrong MIME type can cause browsers to render or block content incorrectly.

What's the difference between application/octet-stream and a specific type?

application/octet-stream is a generic 'unknown binary data' fallback. Using the specific type (like application/pdf) when you know it lets browsers and tools handle the file correctly instead of just offering a generic download.

Why do some extensions map to more than one possible MIME type?

A few extensions have both an older and a newer standardized type (for example, some servers still send text/javascript vs the historical application/javascript for .js files) — this table shows the modern, widely-recommended type.

Can I search by MIME type instead of extension?

Yes. Typing part of a MIME type (like 'json' or 'image/') filters the table the same way searching by extension does.

Is this list exhaustive?

It covers the most common file types developers encounter day to day — text, code, images, audio, video, documents, archives, fonts, and binaries — not the full IANA media types registry, which has thousands of entries.