MIMEタイプ一覧
Content-Typeに何を書くか、間違えるとどうなるか。
- 種類数
- 50
出力
html htm text/html
A web page. Always with charset=utf-8.
css text/css
js mjs text/javascript
application/javascript is obsolete but still served everywhere.
json application/json
No charset parameter: JSON is UTF-8 by definition.
xml application/xml
text/xml is also registered and means the same to browsers.
txt text/plain
csv text/csv
md text/markdown
yaml yml application/yaml
Registered in 2024; text/yaml is what older servers send.
pdf application/pdf
zip application/zip
gz application/gzip
tar application/x-tar
7z application/x-7z-compressed
rar application/vnd.rar
png image/png
jpg jpeg image/jpeg
Note the type is jpeg even when the extension is jpg.
gif image/gif
webp image/webp
avif image/avif
svg image/svg+xml
Served as anything else, a browser will not render it.
ico image/x-icon
image/vnd.microsoft.icon is the registered one; both work.
bmp image/bmp
tif tiff image/tiff
heic image/heic
mp4 m4v video/mp4
webm video/webm
mov video/quicktime
mp3 audio/mpeg
Not audio/mp3, which is not registered.
m4a audio/mp4
wav audio/wav
audio/x-wav and audio/wave appear in the wild too.
ogg oga audio/ogg
flac audio/flac
woff2 font/woff2
woff font/woff
ttf font/ttf
otf font/otf
wasm application/wasm
Must be exact or streaming compilation refuses it.
doc application/msword
docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
xls application/vnd.ms-excel
xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
ppt application/vnd.ms-powerpoint
pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
epub application/epub+zip
ics text/calendar
vcf text/vcard
srt application/x-subrip
vtt text/vtt
Must be exact or the browser ignores the track.
bin application/octet-stream
The fallback: bytes with nothing said about them.ファイルは端末の外に出ません
このツールはすべてブラウザ内で動作します。貼り付けた内容は端末内で処理され、サーバーには送信されないため、トークンや鍵、未公開の文章でも安心して使えます。
使い方
- 空のままにすると一覧が出ます。
- png や .png のように拡張子を入れるとそのタイプが出ます。
- image/ のようにタイプの一部を入れるとその配下がまとめて出ます。
- 注意書きも読んでください。いくつかはエラーを出さずに壊れます。
よくある質問
- 特に重要なのはどれですか?
- 間違えるとブラウザが動作を拒否するものです。SVGをtext/plainで返すと描画されません。WebAssemblyはapplication/wasm以外だとストリーミングできません。.vttの字幕をtext/plainで返すと無視され、動画は字幕なしで、エラーも出ずに再生されます。
- JavaScriptはtext/javascriptとapplication/javascriptのどちらですか?
- text/javascriptです。長年application/javascriptが推奨でしたが現在は廃止扱いです。どちらでも動くので、古いほうも当分は見かけます。
- charset=utf-8は付けるべきですか?
- text/htmlとtext/plainには付けます。application/jsonには付けません。JSONは定義上UTF-8なので、charset指定は無意味です(害はありませんが)。
- application/octet-streamとは何ですか?
- 「何かのバイト列です、中身は申し上げません」という意味です。本当に分からないときの正しい答えで、ブラウザは表示せずダウンロードします。
- サーバーに送信されますか?
- いいえ。ブラウザの中だけで動くので、入力した内容はお使いのパソコンから出ません。