1001Ferramentas
🔍Dev

File Extension by MIME Type Lookup

Type a MIME type such as image/png or application/pdf and read back the matching file extension from a table of 24 common web content types.

Extension

From MIME type to file extension

The MIME type is what tells a browser what to do with the content it received. It travels in Content-Type and has no required relationship to the filename extension — the server decides. When the two disagree, the familiar problems appear: the CSS that is not applied, the script the browser refuses to run, the PDF that opens as text.

Enter the type and the page returns the conventional matching extension, covering what shows up in day-to-day web work: text and data formats, images, fonts, the most common audio and video, and wasm. It is the lookup that solves the practical case of saving a file under the right name when all you have is the response header.

Two things to keep in mind. The relationship is not one to one: the same type accepts more than one extension, such as jpg and jpeg, and the same extension has travelled under different names over the years — JavaScript was text/javascript, then application/javascript, and the current specification went back to text/javascript. And the header can carry parameters after a semicolon, such as charset, which are not part of the type itself.

Frequently asked questions

Why is my CSS not being applied?
Almost always because the server returned the file with a type that is not text/css. In strict mode the browser refuses the stylesheet and logs the warning in the console. The fix is in the server configuration, mapping the extension to the right type — changing the HTML will not help.
Is there a generic type when I do not know which to use?
application/octet-stream is the wildcard for unknown binary, and it makes the browser offer a download rather than trying to display. Useful when you genuinely want to force a download, combined with Content-Disposition attachment — but reaching for it out of laziness on known content gets in the client's way.
Can I trust the type declared on upload?
No. The type a browser sends in a form comes from the user's system and can be forged. Serious validation looks at the file content — the first bytes, the format signature — and never decides security from an extension or a declared type.

Related Tools