DevToolBox

MIME Type Lookup

ブラウザ内で処理

ファイル拡張子とMIMEタイプ(Content-Type)を100種類以上の対応表から双方向にリアルタイム検索します。

112件の形式(164拡張子)

検索結果

拡張子MIMEタイプ
.jpg, .jpeg, .jpeimage/jpeg
.pngimage/png
.gifimage/gif
.svg, .svgzimage/svg+xml
.webpimage/webp
.icoimage/x-icon
.bmp, .dibimage/bmp
.tif, .tiffimage/tiff
.avifimage/avif
.heicimage/heic
.heifimage/heif
.apngimage/apng
.psdimage/vnd.adobe.photoshop
.rawimage/x-raw
.mp4, .m4vvideo/mp4
.webmvideo/webm
.avivideo/x-msvideo
.mov, .qtvideo/quicktime
.mpeg, .mpg, .mpevideo/mpeg
.ogvvideo/ogg
.3gpvideo/3gpp
.3g2video/3gpp2
.mkvvideo/x-matroska
.ts, .mts, .m2tsvideo/mp2t
.flvvideo/x-flv
.wmvvideo/x-ms-wmv
.mp3audio/mpeg
.wavaudio/wav
.ogg, .ogaaudio/ogg
.flacaudio/flac
.aacaudio/aac
.m4aaudio/mp4
.opusaudio/opus
.webaaudio/webm
.mid, .midiaudio/midi
.aif, .aiff, .aifcaudio/aiff
.wmaaudio/x-ms-wma
.amraudio/amr
.pdfapplication/pdf
.doc, .dotapplication/msword
.docxapplication/vnd.openxmlformats-officedocument.wordprocessingml.document
.odtapplication/vnd.oasis.opendocument.text
.rtfapplication/rtf
.txt, .text, .logtext/plain
.csvtext/csv
.tsvtext/tab-separated-values
.xls, .xlt, .xlaapplication/vnd.ms-excel
.xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.odsapplication/vnd.oasis.opendocument.spreadsheet
.ppt, .pps, .potapplication/vnd.ms-powerpoint
.pptxapplication/vnd.openxmlformats-officedocument.presentationml.presentation
.odpapplication/vnd.oasis.opendocument.presentation
.epubapplication/epub+zip
.md, .markdowntext/markdown
.texapplication/x-tex
.html, .htmtext/html
.csstext/css
.js, .mjs, .cjstext/javascript
.json, .mapapplication/json
.jsonldapplication/ld+json
.xml, .xsl, .xsdapplication/xml
.xhtml, .xhtapplication/xhtml+xml
.wasmapplication/wasm
.webmanifestapplication/manifest+json
.atomapplication/atom+xml
.rssapplication/rss+xml
.wofffont/woff
.woff2font/woff2
.ttffont/ttf
.otffont/otf
.eotapplication/vnd.ms-fontobject
.zipapplication/zip
.rarapplication/vnd.rar
.7zapplication/x-7z-compressed
.tarapplication/x-tar
.gz, .gzipapplication/gzip
.bzapplication/x-bzip
.bz2application/x-bzip2
.xzapplication/x-xz
.zstapplication/zstd
.cabapplication/vnd.ms-cab-compressed
.jar, .war, .earapplication/java-archive
.isoapplication/x-iso9660-image
.dmgapplication/x-apple-diskimage
.apkapplication/vnd.android.package-archive
.exe, .dllapplication/vnd.microsoft.portable-executable
.binapplication/octet-stream
.debapplication/vnd.debian.binary-package
.rpmapplication/x-rpm
.ics, .ifbtext/calendar
.vcf, .vcardtext/vcard
.sqlapplication/sql
.yaml, .ymlapplication/yaml
.tomlapplication/toml
.graphql, .gqlapplication/graphql
.proto, .ts, .tsx, .jsx, .ps1, .vue, .sveltetext/plain
.py, .pywtext/x-python
.javatext/x-java-source
.c, .htext/x-c
.cpp, .cc, .cxx, .hpptext/x-c++
.gotext/x-go
.rstext/x-rust
.rbtext/x-ruby
.phpapplication/x-httpd-php
.sh, .bashapplication/x-sh
.swifttext/x-swift
.kt, .ktstext/x-kotlin
.scalatext/x-scala
.luatext/x-lua
.pl, .pmtext/x-perl
.rtext/x-r-source
.darttext/x-dart

対応表は一般的な値です。セキュリティ判定では拡張子やクライアント申告値だけを信用せず、実データも検証してください。

How to Look Up a File's MIME Type

Enter a file extension such as .json or a media type such as application/json. Results are filtered as you type, and partial queries such as image/ list an entire family. A leading dot is optional. The embedded table covers common images, video, audio, documents, web assets, archives, fonts, executables, and source-code files.

What a MIME Type Represents

A media type uses the syntax type/subtype, optionally followed by parameters such as text/html; charset=utf-8. The top-level type describes the broad processing model, while the subtype identifies the representation. Structured suffixes such as +json and +xml tell generic processors which syntax underlies a specialized format.

Content-Type, Content-Disposition, and Browser Behavior

In HTTP, Content-Type declares the representation being transferred. Browsers combine it with context, security rules, and sometimes content sniffing to decide whether to render, execute, parse, or download data. Content-Disposition: attachment explicitly requests download behavior; an incorrect type can display a file as text, prevent scripts or styles from loading, or trigger a download.

File Uploads and multipart/form-data

Each file part can carry its own Content-Type alongside Content-Disposition and the filename. This client-supplied value is not proof of content. Upload handlers should validate an allowlist, size, magic bytes, and parser results on the server.

Specific Types vs application/octet-stream

application/octet-stream means arbitrary binary data with no more specific interpretation. It is a safe fallback for unknown bytes and often leads to download behavior, but it discards useful semantics. Use an accurate registered type when known.

拡張子からMIMEタイプを検索する方法

.pngのような拡張子、またはimage/pngのようなMIMEタイプを検索欄に入力します。先頭のドットは省略可能で、入力するたびに部分一致で候補が絞り込まれます。application/のように大分類だけを入力して一覧を確認する使い方もできます。

MIMEタイプとContent-Typeの仕組み

MIMEタイプ(media type)はtype/subtype形式の識別子です。HTTPレスポンスのContent-Typeは、届いたバイト列がHTML、画像、JSON、PDFなどのどの表現かを受信側へ伝えます。テキストではcharset=utf-8のようなパラメータを付け、文字デコード方式まで指定できます。

図1: 拡張子からMIMEタイプ、Content-Typeヘッダーまでの流れ
拡張子からContent-Typeヘッダーまでの対応関係ファイル名report.pdfの拡張子pdfが対応表を通じてMIMEタイプapplication/pdfに変換され、それがtype部分のapplicationとsubtype部分のpdfに分解され、最終的にHTTPレスポンスのContent-Typeヘッダーとして送信される流れを示す図ファイル名report.pdfMIMEタイプapplication/pdftypeapplicationsubtypepdfContent-Typeヘッダー対応表は拡張子とMIMEタイプを双方向に対応付けるだけで、実データの中身は検証しない

なぜブラウザは拡張子だけを見ないのか

URLには拡張子がないことがあり、拡張子は単なる名前なので実データと一致する保証もありません。ブラウザはHTTPヘッダー、読み込み先の文脈、セキュリティポリシー、場合によってはMIME sniffingを組み合わせます。特にX-Content-Type-Options: nosniffがある場合、誤った型のJavaScriptやCSSは安全のため拒否されます。

標準値と実務上の値

メディアタイプはIANA登録値が基準ですが、古いソフトウェアやOSではx-付きの慣用値も残っています。TypeScriptなどのソースファイルにはWeb配信で広く合意された専用型がなく、text/plainとして扱うのが安全な場面があります。本表は相互運用でよく使われる値を優先しています。

MIME誤設定・文字化け・拡張子偽装の対処 / Fixing MIME misconfiguration, encoding, and spoofed extensions

症状 / Symptom原因 / Cause対処 / Fix
PDFや画像が表示されずダウンロードされる
A PDF or image downloads instead of opening
application/octet-streamまたはattachmentが指定されている
A generic binary type or attachment disposition is set
正確なMIMEタイプを設定し、意図しないattachment指定を外す
Send the specific type and review Content-Disposition
CSSやJavaScriptが読み込まれない
CSS or JavaScript is blocked
text/plainなど誤った型を返し、nosniffで拒否された
A wrong type is returned and nosniff blocks it
CSSはtext/css、JavaScriptはtext/javascriptで配信する
Serve assets with their correct types
JSONが文字化けする
JSON text is garbled
実データと文字エンコーディングが一致していない
The byte encoding does not match expectations
UTF-8で保存・配信し、必要な形式ではcharsetを明示する
Encode as UTF-8 and declare charset where applicable
画像に見せかけた実行ファイルが通る
An executable renamed as an image passes validation
拡張子やクライアントのMIME申告だけを検査している
Validation trusts only client metadata
署名、デコーダ、サイズ、許可リストをサーバー側で検証する
Validate signatures, parsing, size, and an allowlist

MIME判定とContent-Type設定 / Detecting MIME types and setting Content-Type

JavaScript (browser)

const file = input.files[0];
const declaredType = file.type || "application/octet-stream";

await fetch("/upload", {
  method: "POST",
  headers: { "Content-Type": declaredType },
  body: file,
});
// Validate bytes on the server; file.type is client metadata.

Python

import mimetypes

mime_type, encoding = mimetypes.guess_type("report.pdf")
content_type = mime_type or "application/octet-stream"
print(content_type)  # application/pdf
# Extension detection is not security validation.

Go

extType := mime.TypeByExtension(filepath.Ext(name))
contentType := extType
if contentType == "" {
    sample := data
    if len(sample) > 512 { sample = sample[:512] }
    contentType = http.DetectContentType(sample)
}
w.Header().Set("Content-Type", contentType)
_, _ = w.Write(data)

JS配信とPDFプレビューのMIME修正 / Correcting MIME types for JS delivery and PDF previews

静的ホスティングの誤設定

Before: app.jsをtext/plainで返したため、ブラウザがstrict MIME type checkingで実行を拒否。
After: Content-Type: text/javascript; charset=utf-8へ変更し、nosniffを維持したまま安全に読み込めます。

APIからのPDF配信

Before: PDFをapplication/octet-streamとattachmentで返し、ブラウザ内プレビューができない。
After: application/pdfとinline; filename="report.pdf"を設定し、プレビューと保存を可能にします。

社内ファイル名のMIME検索をローカルで / Looking up MIME types for internal filenames locally

Your query can reveal filenames, internal formats, or implementation details. This tool keeps the lookup table in the page and filters it locally: no query, filename, or file content is sent to an API. Searching creates no network request.

検索語には社内ファイル名やシステム構成を推測できる情報が含まれる場合があります。このツールは対応表をページ内に保持し、検索処理をブラウザ内だけで実行します。検索語・ファイル名・ファイル本体を外部APIへ送信しません。

関連ツール・関連ガイド

FAQ

MIMEタイプは拡張子だけで安全に判定できますか?

できません。拡張子は自由に変更でき、file.typeもクライアント申告値です。サーバー側で実データの署名とパーサー結果を検証してください。

multipart/form-dataではどこにMIMEタイプを書きますか?

各ファイルpartのヘッダーにContent-Typeを設定します。通常ブラウザのFormDataが自動設定するため、リクエスト全体のboundaryを含むヘッダーは手動設定しない方が安全です。

未知のファイル形式には何を指定しますか?

適切な登録型を特定できない任意バイナリにはapplication/octet-streamを使えます。ただし既知の型を汎用型に置き換えると、表示・キャッシュ・処理の情報が失われます。

🔒 すべての処理はブラウザ内で完結し、入力データはサーバーへ送信されません。登録不要・無料。 / All processing runs in your browser; nothing is uploaded. Free, no sign-up. プライバシーポリシー / Privacy Policy

参考資料 / References