MIME Type por Extensão
Retorna o MIME type oficial para uma extensão de arquivo.
MIME
—
Picking the right Content-Type for a file extension
The browser downloaded your file instead of opening it, or the stylesheet arrived as text/plain and the page rendered with no styling at all. The Content-Type header the server sent is almost always the culprit. Type an extension, with or without the leading dot, and you get the MIME type to use. The table covers 36 common extensions across web, images, audio, video, fonts and archives.
When an extension is not in the table, the answer is application/octet-stream, which is precisely the value that makes a browser offer a download rather than render the file. Two conventions are worth calling out. The table returns application/javascript for .js, the older form every browser accepts, even though IANA now prefers text/javascript. And it returns image/x-icon for .ico, the de facto value, not the registered image/vnd.microsoft.icon.
The MIME type alone is not enough for text: for HTML, CSS, JS and JSON add charset=utf-8 to the header, or the browser guesses the encoding and your accented characters turn into garbage. If you accept uploads, never trust the extension, since the uploader picks it. Check the leading bytes of the file and serve with X-Content-Type-Options: nosniff. The lookup is a fixed table inside the page and no file is uploaded.
Frequently asked questions
Should I use application/javascript or text/javascript for .js files?
Why does my file download instead of opening in the browser?
Does this tool detect the type from the file contents?
Related Tools
MIME Types (Reference)
Searchable MIME type table — search by extension (.json, .pdf) or MIME (application/json, image/png). Includes common formats for web, audio, video, fonts and documents. Everything in your browser.
NGINX Reverse Proxy Generator
Build an NGINX reverse proxy with backend upstream, default proxy_set_header (Host, X-Real-IP, X-Forwarded-*) and WebSocket support.
CSS Border Radius Generator
Create custom rounded shapes with 8 independent controls (4 corners × 2 axes). Live preview and ready-to-copy CSS. Everything in your browser.