Skip to content
CertoflowCertoflow
Developer Tools

MIME Type Lookup — File Extension to MIME

Extension to MIME type.

Last updated: August 2026

Quick reference

What this calculator does
Look up common MIME types by file extension — png, json, pdf, webp, and more with instant extension-to-content-type mapping.
How it works
Enter a file extension (with or without leading dot) and see the matching MIME type from the built-in reference table.
Example
Extension png returns image/png; json returns application/json.
When to use it
Setting Content-Type headers, configuring S3 uploads, debugging static file servers, or validating API Accept headers.
  • .htmltext/html
  • .csstext/css
  • .jstext/javascript
  • .jsonapplication/json
  • .pngimage/png
  • .jpgimage/jpeg
  • .gifimage/gif
  • .webpimage/webp
  • .svgimage/svg+xml
  • .pdfapplication/pdf
  • .zipapplication/zip
  • .mp4video/mp4
  • .mp3audio/mpeg
  • .woff2font/woff2

Guide

Introduction

Browsers, CDNs, and object storage decide how to handle files largely from MIME types — Content-Type: application/json versus text/plain changes whether fetch parses JSON automatically. Mislabeling image/svg+xml as image/png breaks rendering; serving HTML as text/plain mitigates some XSS vectors but breaks scripts. Developers grep MDN or Wikipedia for video/mp4 when configuring nginx types blocks or AWS S3 metadata.

Certoflow's MIME Type Lookup maps common file extensions to standard MIME types: HTML, CSS, JavaScript, JSON, images, PDF, archives, media, and fonts. Type an extension — png, .webp, or JSON — and see the match instantly. A full reference list displays below for browsing. Processing is local. Pair with HTTP Status Code Lookup when wrong types accompany 404s, and Base64 Encode when embedding small assets in data URLs with correct type metadata.

What this tool does

FeatureBehavior
Extension inputAccepts with or without leading dot
Lookup resultShows MIME type in monospace panel when matched
No match messageDisplays when extension unknown to reference table
Reference listTwo-column browse of all supported extensions

Supported mappings include:

ExtensionMIME Type
htmltext/html
csstext/css
jstext/javascript
jsonapplication/json
pngimage/png
jpgimage/jpeg
gifimage/gif
webpimage/webp
svgimage/svg+xml
pdfapplication/pdf
zipapplication/zip
mp4video/mp4
mp3audio/mpeg
woff2font/woff2

How it works

Lookup normalizes input by stripping a leading dot and lowercasing:

const match = MIME_TYPES.find((m) => m.ext === ext.replace(/^\./, "").toLowerCase());

The static MIME_TYPES array drives both search and the browse list. No sniffing of file contents — extension-only heuristic. Unknown extensions like wasm or avif return the "No common MIME type" message until the table expands.

Real-world examples

S3 object upload metadata

Uploading report.pdf requires Content-Type: application/pdf for inline browser viewing. Confirm before CLI aws s3 cp --content-type.

Express static middleware

Configuring express.static with custom types for .json API schema files — verify application/json versus deprecated text/json debates.

Email attachment headers

MIME types in multipart emails must match attachment extensions. Cross-check before sending through transactional providers.

OpenAPI file upload specs

Document allowed image/png and image/jpeg for avatar endpoints. Lookup extensions when writing enum constraints.

SVG security reviews

Confirm image/svg+xml for SVG assets — serving SVG as HTML MIME type reintroduces script execution risks. Pair security review with Strip HTML Tags when sanitizing untrusted markup.

Common mistakes

Trusting extension alone for security. Attackers upload .jpg files containing script. Validate magic bytes server-side, not only MIME from extension.

Using outdated JavaScript MIME. Historically application/javascript and text/javascript competed — this tool lists text/javascript per current common practice; follow your CDN's canonical choice.

Assuming comprehensive coverage. Obscure formats (.heic, .avif, .wasm) are absent — consult IANA media types for new formats.

Case-sensitive extensions on disk versus lookup. Lookup lowercases input; filesystems on macOS may be case-insensitive while Linux is not.

Wrong type for downloadable JSON. application/json displays in browser; application/octet-stream forces download — choose intentionally.

Confusing jpg and jpeg. Tool maps jpg to image/jpeg — both extensions exist in the wild.

Use cases

Backend developers setting response headers correctly.

DevOps engineers configuring nginx mime.types and CDN rules.

Frontend developers choosing accept attributes on file inputs.

QA testers verifying Content-Type in API integration tests.

Technical writers documenting upload format requirements.

Students learning relationship between extensions and HTTP headers.

FAQ

Does this read file contents?

No. Extension string only — no upload or magic-byte detection.

Is the leading dot required?

Optional. Both png and .png work.

What if no match appears?

The extension is not in Certoflow's common reference table — consult IANA or vendor docs.

Is the list exhaustive?

No. Fourteen common web development types are included.

Why text/javascript for .js?

Matches prevalent browser and spec usage in modern stacks.

Can I lookup by MIME type reverse?

Not in this tool — browse the reference list manually.

Offline support?

Yes, after page load.

Related header tools?

CORS Header Generator for cross-origin API responses.

Difference from server mime.types?

Server files may include hundreds more mappings — this is a quick dev reference.

SVG safety note?

image/svg+xml can execute script when embedded — sanitize untrusted SVG.

Frequently Asked Questions

Is data uploaded?
No. All processing runs locally in your browser.
Does this work offline?
Yes, after the page loads.

Related tools that complement this workflow.