MIME Type Lookup
ファイル拡張子とMIMEタイプ(Content-Type)を100種類以上の対応表から双方向にリアルタイム検索します。
| 拡張子 | MIMEタイプ | カテゴリ |
|---|---|---|
| .jpg, .jpeg, .jpe | image/jpeg | 画像 |
| .png | image/png | 画像 |
| .gif | image/gif | 画像 |
| .svg, .svgz | image/svg+xml | 画像 |
| .webp | image/webp | 画像 |
| .ico | image/x-icon | 画像 |
| .bmp, .dib | image/bmp | 画像 |
| .tif, .tiff | image/tiff | 画像 |
| .avif | image/avif | 画像 |
| .heic | image/heic | 画像 |
| .heif | image/heif | 画像 |
| .apng | image/apng | 画像 |
| .psd | image/vnd.adobe.photoshop | 画像 |
| .raw | image/x-raw | 画像 |
| .mp4, .m4v | video/mp4 | 動画 |
| .webm | video/webm | 動画 |
| .avi | video/x-msvideo | 動画 |
| .mov, .qt | video/quicktime | 動画 |
| .mpeg, .mpg, .mpe | video/mpeg | 動画 |
| .ogv | video/ogg | 動画 |
| .3gp | video/3gpp | 動画 |
| .3g2 | video/3gpp2 | 動画 |
| .mkv | video/x-matroska | 動画 |
| .ts, .mts, .m2ts | video/mp2t | 動画 |
| .flv | video/x-flv | 動画 |
| .wmv | video/x-ms-wmv | 動画 |
| .mp3 | audio/mpeg | 音声 |
| .wav | audio/wav | 音声 |
| .ogg, .oga | audio/ogg | 音声 |
| .flac | audio/flac | 音声 |
| .aac | audio/aac | 音声 |
| .m4a | audio/mp4 | 音声 |
| .opus | audio/opus | 音声 |
| .weba | audio/webm | 音声 |
| .mid, .midi | audio/midi | 音声 |
| .aif, .aiff, .aifc | audio/aiff | 音声 |
| .wma | audio/x-ms-wma | 音声 |
| .amr | audio/amr | 音声 |
| application/pdf | 文書 | |
| .doc, .dot | application/msword | 文書 |
| .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | 文書 |
| .odt | application/vnd.oasis.opendocument.text | 文書 |
| .rtf | application/rtf | 文書 |
| .txt, .text, .log | text/plain | 文書 |
| .csv | text/csv | 文書 |
| .tsv | text/tab-separated-values | 文書 |
| .xls, .xlt, .xla | application/vnd.ms-excel | 文書 |
| .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 文書 |
| .ods | application/vnd.oasis.opendocument.spreadsheet | 文書 |
| .ppt, .pps, .pot | application/vnd.ms-powerpoint | 文書 |
| .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | 文書 |
| .odp | application/vnd.oasis.opendocument.presentation | 文書 |
| .epub | application/epub+zip | 文書 |
| .md, .markdown | text/markdown | 文書 |
| .tex | application/x-tex | 文書 |
| .html, .htm | text/html | Web |
| .css | text/css | Web |
| .js, .mjs, .cjs | text/javascript | Web |
| .json, .map | application/json | Web |
| .jsonld | application/ld+json | Web |
| .xml, .xsl, .xsd | application/xml | Web |
| .xhtml, .xht | application/xhtml+xml | Web |
| .wasm | application/wasm | Web |
| .webmanifest | application/manifest+json | Web |
| .atom | application/atom+xml | Web |
| .rss | application/rss+xml | Web |
| .woff | font/woff | フォント |
| .woff2 | font/woff2 | フォント |
| .ttf | font/ttf | フォント |
| .otf | font/otf | フォント |
| .eot | application/vnd.ms-fontobject | フォント |
| .zip | application/zip | アーカイブ |
| .rar | application/vnd.rar | アーカイブ |
| .7z | application/x-7z-compressed | アーカイブ |
| .tar | application/x-tar | アーカイブ |
| .gz, .gzip | application/gzip | アーカイブ |
| .bz | application/x-bzip | アーカイブ |
| .bz2 | application/x-bzip2 | アーカイブ |
| .xz | application/x-xz | アーカイブ |
| .zst | application/zstd | アーカイブ |
| .cab | application/vnd.ms-cab-compressed | アーカイブ |
| .jar, .war, .ear | application/java-archive | アーカイブ |
| .iso | application/x-iso9660-image | アーカイブ |
| .dmg | application/x-apple-diskimage | アーカイブ |
| .apk | application/vnd.android.package-archive | 実行形式 |
| .exe, .dll | application/vnd.microsoft.portable-executable | 実行形式 |
| .bin | application/octet-stream | 実行形式 |
| .deb | application/vnd.debian.binary-package | 実行形式 |
| .rpm | application/x-rpm | 実行形式 |
| .ics, .ifb | text/calendar | データ |
| .vcf, .vcard | text/vcard | データ |
| .sql | application/sql | 開発 |
| .yaml, .yml | application/yaml | 開発 |
| .toml | application/toml | 開発 |
| .graphql, .gql | application/graphql | 開発 |
| .proto, .ts, .tsx, .jsx, .ps1, .vue, .svelte | text/plain | 開発 |
| .py, .pyw | text/x-python | 開発 |
| .java | text/x-java-source | 開発 |
| .c, .h | text/x-c | 開発 |
| .cpp, .cc, .cxx, .hpp | text/x-c++ | 開発 |
| .go | text/x-go | 開発 |
| .rs | text/x-rust | 開発 |
| .rb | text/x-ruby | 開発 |
| .php | application/x-httpd-php | 開発 |
| .sh, .bash | application/x-sh | 開発 |
| .swift | text/x-swift | 開発 |
| .kt, .kts | text/x-kotlin | 開発 |
| .scala | text/x-scala | 開発 |
| .lua | text/x-lua | 開発 |
| .pl, .pm | text/x-perl | 開発 |
| .r | text/x-r-source | 開発 |
| .dart | text/x-dart | 開発 |
対応表は一般的な値です。セキュリティ判定では拡張子やクライアント申告値だけを信用せず、実データも検証してください。
How to Use
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.
使い方
.pngのような拡張子、またはimage/pngのようなMIMEタイプを検索欄に入力します。先頭のドットは省略可能で、入力するたびに部分一致で候補が絞り込まれます。application/のように大分類だけを入力して一覧を確認する使い方もできます。
MIMEタイプとContent-Typeの仕組み
MIMEタイプ(media type)はtype/subtype形式の識別子です。HTTPレスポンスのContent-Typeは、届いたバイト列がHTML、画像、JSON、PDFなどのどの表現かを受信側へ伝えます。テキストではcharset=utf-8のようなパラメータを付け、文字デコード方式まで指定できます。
なぜブラウザは拡張子だけを見ないのか
URLには拡張子がないことがあり、拡張子は単なる名前なので実データと一致する保証もありません。ブラウザはHTTPヘッダー、読み込み先の文脈、セキュリティポリシー、場合によってはMIME sniffingを組み合わせます。特にX-Content-Type-Options: nosniffがある場合、誤った型のJavaScriptやCSSは安全のため拒否されます。
標準値と実務上の値
メディアタイプはIANA登録値が基準ですが、古いソフトウェアやOSではx-付きの慣用値も残っています。TypeScriptなどのソースファイルにはWeb配信で広く合意された専用型がなく、text/plainとして扱うのが安全な場面があります。本表は相互運用でよく使われる値を優先しています。
よくあるエラーと対処 / Common Errors and Fixes
| 症状 / 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 |
言語別コード例 / Code Examples
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)Before / After 実例
静的ホスティングの誤設定
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"を設定し、プレビューと保存を可能にします。
Why browser-only?
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へ送信しません。
関連ツール・関連ガイド
- Image Format Converter — PNG・JPEG・WebPを変換
- Image to Base64 — 画像をMIMEタイプ付きData URIへ変換
- Base64 Encoder / Decoder — バイナリやテキストのBase64表現を確認
- URL Parser — ファイル配信URLを構成要素へ分解
FAQ
MIMEタイプは拡張子だけで安全に判定できますか?
できません。拡張子は自由に変更でき、file.typeもクライアント申告値です。サーバー側で実データの署名とパーサー結果を検証してください。
multipart/form-dataではどこにMIMEタイプを書きますか?
各ファイルpartのヘッダーにContent-Typeを設定します。通常ブラウザのFormDataが自動設定するため、リクエスト全体のboundaryを含むヘッダーは手動設定しない方が安全です。
未知のファイル形式には何を指定しますか?
適切な登録型を特定できない任意バイナリにはapplication/octet-streamを使えます。ただし既知の型を汎用型に置き換えると、表示・キャッシュ・処理の情報が失われます。
関連ツール / Related Tools
開発をもっと効率的に
PR
レンタルサーバー
エックスサーバー
国内シェアNo.1の高速レンタルサーバー(エックスサーバー社調べ)。WordPressも簡単セットアップ。
詳しく見る →レンタルサーバー
ConoHa WING
国内最速クラスのレンタルサーバー。独自ドメイン永久無料特典付き(特典内容は変更される場合があります)。
詳しく見る →レンタルサーバー
mixhost
高速SSD・HTTP/3対応のクラウド型レンタルサーバー。
詳しく見る →VPS
シンVPS
メモリ単価が国内最安水準・オールNVMe SSD搭載の高性能VPS(大容量メモリプラン利用時)。開発・検証環境の構築に。
詳しく見る →Windows VPS
ConoHa for Windows Server
Windows環境のVPS。リモートデスクトップで開発・検証環境を構築。
詳しく見る →