Nouplo

Types MIME

Ce qu’il faut mettre dans Content-Type, et ce qui arrive quand c’est faux.

types
50
Résultat
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.

Vos fichiers restent sur votre appareil

Cet outil fonctionne entièrement dans votre navigateur. Ce que vous collez est traité sur votre appareil et n’est jamais envoyé à un serveur : vous pouvez l’utiliser sans crainte avec des jetons, des clés et des textes non publiés.

Comment ça marche

  1. Laissez le champ vide pour la liste.
  2. Tapez une extension — png, ou .png — pour son type.
  3. Tapez une partie d’un type, comme image/, pour tout ce qui en relève.
  4. Lisez les notes : quelques-uns échouent discrètement plutôt que bruyamment.

Questions fréquentes

Lesquels comptent vraiment ?
Ceux sur lesquels un navigateur refuse d’agir quand ils sont faux. Un SVG servi en text/plain ne s’affiche pas. Un module WebAssembly servi autrement qu’en application/wasm ne peut pas être diffusé en flux. Un fichier de sous-titres .vtt avec le mauvais type ne se charge pas, sans rien dire.
C’est text/javascript ou application/javascript ?
text/javascript. application/javascript a été la recommandation pendant des années et est désormais obsolète, mais les deux fonctionnent partout et vous continuerez à croiser l’ancienne.
Faut-il ajouter charset=utf-8 ?
À text/html et text/plain, oui. Pas à application/json : le JSON est de l’UTF-8 par définition, et un paramètre charset dessus ne veut rien dire, même s’il est inoffensif.
Qu’est-ce que application/octet-stream ?
« Des octets, et je ne vous dirai pas lesquels. » C’est la bonne réponse quand on ne sait vraiment pas, et cela pousse un navigateur à télécharger plutôt qu’à afficher.
Quelque chose part-il vers un serveur ?
Non. Tout tourne dans le navigateur : ce que vous saisissez reste sur votre ordinateur.

Outils associés