· 4 min read
How to Look Up a MIME Type by File Extension
Heshan Fernando
Co-founder & COO
You’re setting a Content-Type header for a file upload, configuring a web server’s MIME type mapping, or writing an API that needs to declare what kind of file it’s serving, and you need the exact MIME type string for a .svg or a .json or a .woff2 file — not a guess, the actual registered value the specification expects. MIME types aren’t always intuitive from the file extension alone (is a .js file text/javascript or application/javascript? the answer has actually changed over time), and getting it wrong can cause a browser or API client to handle the file incorrectly.
Search engines can usually get you there eventually, but a dedicated reference you can search directly is faster than piecing together an answer from scattered results.
What MIME types actually are
A MIME type (also called a content type) is a standardized string identifying the format of a file or data stream — image/png, application/json, text/css, and similar — used in HTTP headers, email attachments, and file upload handling to tell the receiving system what kind of content it’s dealing with, independent of the file’s name or extension. The file extension is just a naming convention; the MIME type is what actually governs how many systems decide to process or display the content.
Most extensions map to one standard, well-established MIME type, but a handful have genuinely ambiguous or historically inconsistent mappings — JavaScript files being a notable example, where the officially recommended MIME type has changed over the years, and different systems in the wild haven’t all fully caught up.
Why people get stuck here
- Not every extension maps obviously to its MIME type.
.svgbeingimage/svg+xmlrather than something more predictable, for instance, isn’t something most people would guess correctly on the first try. - Some MIME type conventions have changed over time. JavaScript’s recommended MIME type has shifted, and legacy systems, current specifications, and various tools don’t always agree, adding real confusion.
- Wrong MIME types cause real functional bugs. A file served with an incorrect content type can be rendered incorrectly, blocked by security policies, or misinterpreted by the receiving application entirely.
- Manually searching for each one is slower than a direct reference. Piecing together an answer from scattered search results, one extension at a time, is slower than having a searchable reference table.
What a good MIME type lookup looks like
Covers a genuinely broad set of common extensions
A reference limited to only the most obvious types (like .jpg and .png) misses exactly the less-common extensions people actually need to look up.
Searches instantly as you type
Live filtering, rather than a static list you have to scroll through, gets you to the answer faster.
Reflects accurate, current standard values
The listed MIME types should match actual registered or widely-adopted standard values, not outdated or inconsistent conventions.
Common mistakes to avoid
- Guessing a MIME type based on what seems intuitive rather than checking the actual standard value, especially for less common file types.
- Using an outdated MIME type convention for a file type whose recommended value has changed over time (like JavaScript).
- Setting an incorrect
Content-Typeheader, which can cause a browser to render or block content unexpectedly. - Assuming every file extension maps to exactly one universally agreed MIME type — a few genuinely have historical inconsistency across different systems.
How to do it with the MIME Type Lookup
Online Tool Store’s MIME Type Lookup searches file extensions and their MIME types entirely in your browser.
- Start typing a file extension.
- See matching MIME types filtered instantly as you type.
- Copy the correct MIME type string for your use case.
- Use it in your HTTP headers, server config, or API code.
Because the lookup happens instantly and locally, it’s faster than searching for the answer scattered across different reference pages.
Frequently asked questions
What’s the difference between a file extension and a MIME type?
A file extension (like .png) is a naming convention indicating file type based on the filename; a MIME type (like image/png) is the standardized identifier actually used by HTTP, email, and other systems to declare content type — they’re related but distinct, and a file’s extension doesn’t automatically determine its declared MIME type in a data transfer.
Why does JavaScript have more than one associated MIME type?
The officially recommended MIME type for JavaScript has changed over the years (from older values toward text/javascript as the current standard recommendation), and because adoption of specification changes takes time across the ecosystem, you may still encounter older values in some existing systems and documentation.
What happens if I use the wrong MIME type for a file?
Depending on the context, an incorrect MIME type can cause a browser to render content incorrectly, trigger unexpected download behavior instead of inline display, or be blocked entirely by content-type security policies — getting it right matters for both functionality and security.
Final thought
MIME types look like they should be obvious from a file’s extension, and mostly are — until you hit one of the handful of genuinely inconsistent or non-intuitive cases, which is exactly when a quick, accurate reference saves you from a guess that causes a real bug.