MIME Type Lookup
Look up common MIME types by extension and extension by MIME value.
MIME Type Lookup
MIME: application/json
Extension: json
What This Tool Does
- A MIME type (Multipurpose Internet Mail Extensions), now formally known as a media type, is a standard identifier used to indicate the format of a file or data stream. Standardized originally under RFC 2045 and RFC 2046 for email attachments, media types are crucial on the modern web. They tell browsers how to render file content: whether to display a file as an HTML document, play it as audio, render it as an image, or prompt the user to download it as a binary file.
- Media types consist of a two-part identifier: a type (such as text, image, or application) and a subtype (such as html, png, or json), separated by a slash (e.g., text/html). When a web server serves a resource, it must include a Content-Type header specifying the correct MIME type. If a server serves a CSS stylesheet with a text/plain or incorrect MIME type, modern browsers will block the script from executing for security reasons, resulting in layout issues.
- The MIME Type Lookup tool on ScriptPulse.tools maps file extensions to their corresponding media type definitions and vice versa. Developers can query file formats, retrieve exact Content-Type headers, and find common extensions. Running entirely client-side, the tool serves as a quick reference directory for server deployments, file uploads validation, and web routing configurations.
How It Works
- The tool maps file extensions to their corresponding MIME types using an internal lookup dictionary of common web formats.
- Users can input either a file extension (e.g., .json or json) or a full MIME type (e.g., application/json).
- The lookup engine queries the mapping, returning the standard media type identifier, subtype description, and common usage categories.
- Results are rendered in clean lists with easy copy buttons, facilitating fast integrations into server configurations and code fixtures.
Usage
- Enter the file extension (e.g., svg) or the full MIME type (e.g., image/svg+xml) in the lookup search field.
- The tool performs a lookup and returns matching extension or MIME details instantly.
- Review the normalized MIME name, primary category (text, image, application), and compatibility notes.
- Use the copy button to copy the MIME type or extension to your clipboard.
- Paste the header value into your server config files, upload validators, or API response logic.
Examples
- SVG Image — Searching svg returns image/svg+xml, which is critical for vector graphic rendering in browsers.
- JSON API Response — Looking up json mapping returns application/json, which is the standard for web API data payloads.
- Web Assembly — Searching wasm returns application/wasm, required by browsers to run WASM binaries.
- Plain Text — Querying txt yields text/plain, which is standard for unformatted text outputs.
- MIME to Extension — Inputting application/pdf returns the extension .pdf for file mapping logic.
Real-World Use Cases
- Configuring server Content-Type headers in Nginx or Apache config files to serve assets correctly.
- Validating user file uploads client-side by checking that uploaded files match allowed MIME type patterns.
- Mapping file extensions during database migrations to store asset type fields consistently.
- Setting up correct response headers in cloud storage buckets (like AWS S3 or Google Cloud Storage) during deployment.
- Troubleshooting stylesheet loading issues caused by mismatched or blocked MIME types.
Best Practices
- Always pair file extension checks with actual file signature (magic numbers) analysis during file uploads.
- Send the X-Content-Type-Options: nosniff security header to prevent browsers from guessing MIME types and executing malicious code.
- Use lowercase letters for all extensions and media type declarations in configurations to avoid routing mismatches.
- Explicitly define charset parameters (e.g., text/html; charset=utf-8) for all text-based media types.
- Keep your server MIME type mappings up to date to support modern formats like WebP or AVIF images.
Common Mistakes
- Relying on file extensions alone for security checks: attackers can rename a malicious .exe file to .jpg to bypass extension filters.
- Serving CSS files with text/plain headers, causing browsers to block stylesheets under strict MIME-sniffing policies.
- Confusing MIME types with encoding profiles (e.g. omitting the charset variable like charset=utf-8 on text media types).
- Using deprecated MIME types (like text/javascript or application/x-javascript instead of the modern standard text/javascript).
- Mismapping formats (like serving .ico files with incorrect images types, preventing browser bookmark bar display).
Limitations
- Results should be validated in your target runtime before production use.
- Extremely large input payloads may be constrained by browser memory and performance limits.
Technical Reference Guide
- RFC 2045 / RFC 2046: Standards defining Multipurpose Internet Mail Extensions (MIME) format, data body structures, and media type mappings.
- Primary Categories: application (binary data), audio (sound files), image (graphics), text (readable source), video (moving images).
- Common headers: Content-Type defines response data format; Accept defines client-requested formats.
FAQ
What does MIME stand for?
MIME stands for Multipurpose Internet Mail Extensions. It was originally designed to support non-ASCII text and file attachments in emails, and it was later adopted as the standard for identifying resource formats on the web.
Why do browsers block stylesheets with incorrect MIME types?
Browsers enforce security rules to prevent cross-site scripting (XSS). If a stylesheet has a non-CSS MIME type, the browser blocks it to prevent malicious scripts from masquerading as styles.
What is MIME sniffing?
MIME sniffing is a browser technique where the browser inspects the bytes of a file to guess its format, ignoring the server Content-Type header. Sending X-Content-Type-Options: nosniff disables this behavior.
How do I restrict file uploads to images in HTML?
You can use the accept attribute in file inputs (e.g., <input type="file" accept="image/png, image/jpeg">) to restrict selections to specific MIME types in the browser.
What is the correct MIME type for JavaScript?
The standard MIME type for JavaScript files is text/javascript. Although other values (like application/javascript) were used in the past, standard specifications now designate text/javascript as the canonical type.
Is this lookup database stored on a server?
No. The MIME lookup dictionary is bundled client-side. Searches execute instantly in the browser and do not send query terms over the network.
What are experimental or vendor-specific MIME types?
Vendor-specific MIME types start with application/vnd. (e.g., application/vnd.ms-excel for Excel files). Experimental types often start with application/x- (e.g., application/x-tar for tarballs).
What is the MIME type for WebP images?
The MIME type for WebP graphics is image/webp. This format is widely used to serve compressed, lightweight images to modern web browsers.
Related Tools
Explore related utilities inside the Web Studio workshop for complementary engineering workflows.
View all Web Studio tools