Skip to content
🛠️ToolsShed

MIME Type Lookup

Look up MIME types by file extension or find extensions for a given MIME type.

Common MIME types

ExtensionMIME Type
jpg / jpegimage/jpeg
pngimage/png
gifimage/gif
webpimage/webp
svgimage/svg+xml
mp4video/mp4
mp3audio/mpeg
pdfapplication/pdf
jsonapplication/json
htmltext/html
csstext/css
jstext/javascript
zipapplication/zip
xmlapplication/xml
csvtext/csv

About this tool

MIME types (Multipurpose Internet Mail Extensions) are standardized labels that identify file formats across the web. Every time a browser downloads a file or a server sends data, a MIME type tells the system what kind of content it is—whether it's a PDF document, a JPEG image, a JavaScript file, or an audio stream. Understanding MIME types is essential for web developers, system administrators, and anyone working with file uploads, API responses, or content delivery.

This tool lets you instantly look up MIME types by file extension or reverse-lookup file extensions for a given MIME type. Simply enter a file extension like .pdf or .jpg to see its corresponding MIME type and description, or enter a MIME type like application/json to find all associated file extensions. It covers hundreds of common and specialized file types, from text formats (plain, CSV, XML) to media (audio, video, image), documents (Word, Excel, PowerPoint), archives (ZIP, TAR, RAR), and programming languages.

MIME type lookups are particularly useful when configuring web servers, setting up file upload restrictions, debugging API content-type mismatches, or building file management systems. The tool saves time and eliminates guessing—especially for obscure formats or when you need to verify correct MIME declarations for web standards compliance. Developers and DevOps teams rely on accurate MIME type information to ensure proper file handling and secure file operations.

Frequently Asked Questions

Code Implementation

import mimetypes

# Guess MIME type from a filename or URL
mime_type, encoding = mimetypes.guess_type('report.pdf')
print(mime_type)   # application/pdf
print(encoding)    # None

print(mimetypes.guess_type('archive.tar.gz'))   # ('application/x-tar', 'gzip')
print(mimetypes.guess_type('style.css'))        # ('text/css', None)
print(mimetypes.guess_type('data.json'))        # ('application/json', None)
print(mimetypes.guess_type('image.svg'))        # ('image/svg+xml', None)

# Guess extension from MIME type
ext = mimetypes.guess_extension('image/jpeg')
print(ext)  # .jpeg (or .jpg depending on platform)

# Add a custom mapping
mimetypes.add_type('application/x-custom', '.myext')

# List all known types
for ext, mime in list(mimetypes.types_map.items())[:5]:
    print(f"{ext:15s} -> {mime}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.