Skip to main content

MIME Type Checker & Content-Type Inspector

Look up IANA media types, verify file uploads locally using binary magic bytes, compare extension-to-header mappings, and audit remote HTTP Content-Type and X-Content-Type-Options security headers.

MIME Type Checker & Content-Type Inspector — Interactive Browser WorkspaceLook up IANA media types, verify file uploads locally using binary magic bytes, compare extension-to-header mappings, and audit remote HTTP Content-Type and X-Content-Type-Options security headers.
100% Client-Side • Zero Server Upload
Sample Input / Parameters — PNG Image Lookup
png
Ready locally via WebAssembly & JavaScript
Expected Output / Live Result
MIME Type: image/png
Category: Image
Browser Behavior: Renders inline as static/animated image
Magic Bytes: 89 50 4E 47 0D 0A 1A 0A
Security status: Safe
100% Client-Side • Zero Server Upload

Web browsers do not decide how to process an HTTP response by looking at the .png, .js, or .pdf suffix in a URL. Rendering engines, JavaScript runtimes, and download managers rely on the server's Content-Type header — and when that header is missing, misconfigured, or overly generic, fallback MIME sniffing can silently break stylesheets or turn an innocent user upload into an executable Cross-Site Scripting (XSS) payload. The MIME Type Checker & Content-Type Inspector combines an IANA media type reference, an extension-to-header comparator, a local binary magic-byte validator, and a remote HTTP header auditor in one diagnostic workspace.

Media Type Grammar and HTTP Header Semantics

Defined by RFC 6838 and carried over HTTP per RFC 9110, a media type follows the structure type/subtype followed by optional semicolon-delimited parameters such as character encoding:

Content-Type: text/html; charset=utf-8
Content-Disposition: inline
X-Content-Type-Options: nosniff

Every media type belongs to a top-level discrete registry (text, image, audio, video, font, application) or composite tree (multipart, message). Subtypes often carry structural signals:

  • Registration trees: Vendor-specific formats use the vnd. prefix (for example, application/vnd.android.package-archive for .apk), while legacy unregistered types historically used x- (application/x-msdownload).
  • Structured syntax suffixes: Suffixes like +xml (image/svg+xml) and +json (application/ld+json) declare the underlying parser grammar. Notably, because SVG is XML, serving untrusted .svg uploads inline permits embedded <script> execution under your site's origin.
  • Standardized updates and extension collisions: RFC 9239 formally retired application/javascript in favor of text/javascript for both classic scripts and .mjs ES modules — a critical distinction when browsers enforce strict MIME checks on <script type="module">. Extension collisions also trip up static file servers: .ts, for instance, maps officially to MPEG-2 Transport Streams (video/mp2t, starting with sync byte 0x47) even though developers commonly associate it with TypeScript source files, while unknown binaries fall back to application/octet-stream to trigger safe downloads.

Content-Disposition pairs directly with Content-Type: inline instructs the browser to render supported media inside the viewport, whereas attachment; filename="report.pdf" forces a file download even for normally renderable assets.

Binary File Signatures (Magic Bytes) Reference

Validating uploads exclusively by filename extension or the browser's File.type property is insecure because both values come from untrusted client metadata. True format verification inspects the binary signature (magic bytes) embedded in the file header.

When you drop a file into the Upload Validator tab, the browser never transmits the file across the network. Instead, File.slice(0, 16) extracts only the leading 16 bytes into a local ArrayBuffer, renders the hexadecimal and printable ASCII view, and checks both offset-0 signatures and container-specific interior offsets (bytes 8–11 for RIFF sub-formats and bytes 4–7 for ISO Base Media ftyp atoms).

ExtensionOfficial MIME TypeHex Magic BytesOffsetSecurity & Parsing Profile
.pngimage/png89 50 4E 47 0D 0A 1A 0A0Safe raster image; check EXIF/tEXt chunks if stripping metadata
.jpgimage/jpegFF D8 FF0Safe raster image; image/jpg is a non-standard alias
.webpimage/webp52 49 46 46 ... 57 45 42 500 & 8RIFF container (RIFF + FourCC WEBP at byte 8)
.mp4video/mp466 74 79 70 (ftyp)4ISO Base Media container preceded by 4-byte box size
.pdfapplication/pdf25 50 44 46 (%PDF)0Inline viewer; can embed JavaScript actions in PDF engines
.zip / .apkapplication/zip50 4B 03 04 (PK..)0Shared container for ZIP, DOCX, XLSX, JAR, and Android APK
.wasmapplication/wasm00 61 73 6D (\0asm)0Requires exact application/wasm for instantiateStreaming()
.exeapplication/x-msdownload4D 5A (MZ)0High-risk native executable; flag immediately if spoofed as image
.svgimage/svg+xml3C 73 76 67 (<svg)0XML vector graphic; high XSS hazard if user-uploaded inline

Stopping MIME Sniffing and Hardening Server Headers

Under the WHATWG MIME Sniffing Standard, if an origin returns text/plain or omits Content-Type without setting X-Content-Type-Options: nosniff, browsers inspect the first bytes of the response to guess its real format. Attackers exploit this by crafting polyglot files (such as valid GIF headers followed by HTML/JavaScript) to achieve stored XSS when hosted on your primary domain.

Enforce strict MIME matching on every web server and verify responses from the command line:

# Nginx: enforce strict MIME adherence and force download on untrusted uploads
add_header X-Content-Type-Options "nosniff" always;

location /user-uploads/ {
    add_header Content-Disposition "attachment" always;
    add_header X-Content-Type-Options "nosniff" always;
}
# Quick CLI verification of live Content-Type and nosniff headers
curl -sI https://example.com/assets/app.wasm | grep -iE 'content-type|x-content-type-options|content-disposition'

If you host on Apache, generate properly scoped AddType and Header always set X-Content-Type-Options "nosniff" directives with the .htaccess Generator. To audit surrounding transport and framing policies such as HSTS, CSP, and CORS alongside media types, run the full endpoint through the HTTP Header Checker. And when inlining icons or binary assets into CSS or HTML as data:<mime>;base64,... URIs, pair verified media types with the Base64 Encoder so browsers decode the embedded payload accurately.

Execution Boundaries and URL Inspection Safeguards

This inspector separates local analysis from live network auditing cleanly. Extension lookups, magic-byte file verification, extension-vs-MIME comparisons, and full database browsing execute exclusively inside your browser with zero file uploads. When you audit an external link on the URL Inspector tab, a lightweight backend endpoint issues a HEAD request (automatically falling back to GET if the remote server blocks HEAD) so browser CORS policies do not conceal response headers. Before connecting, the endpoint resolves target DNS records and blocks RFC 1918 private networks, loopback addresses (127.0.0.0/8, ::1), and link-local ranges (169.254.0.0/16, fe80::/10) to prevent SSRF exposure, while exporting any lookup, file signature check, or live header audit to JSON or plain text for engineering tickets.

How to Use MIME Type Checker & Content-Type Inspector

1

Use the Lookup tab to search by file extension (such as .wasm or .svg), MIME string, or description to view canonical headers, aliases, and security guidance.

2

Switch to the URL Inspector tab and enter any public HTTPS asset URL to audit live Content-Type, charset, Content-Disposition, and nosniff headers.

3

Open the Upload Validator tab and drop a local file to inspect its first 16 bytes in hex and ASCII and detect extension spoofing without uploading the file.

4

Use the Compare tab to test any extension against a candidate Content-Type header and check compatibility under strict nosniff enforcement.

5

Browse the full Database tab filtered by category (Text, Image, Audio, Video, Font, Archive, Application, Binary) and export any diagnostic audit as JSON or TXT.

Real Examples

PNG Image Lookup

Typical metadata lookup parameters for a standard PNG graphics file.

Input
png
Output
MIME Type: image/png
Category: Image
Browser Behavior: Renders inline as static/animated image
Magic Bytes: 89 50 4E 47 0D 0A 1A 0A
Security status: Safe

PDF Document Lookup

Lookup configuration indicating how browsers manage PDF assets.

Input
.pdf
Output
MIME Type: application/pdf
Category: Application
Browser Behavior: Renders inline with built-in viewer or prompts download
Magic Bytes: 25 50 44 46
Security status: Warning (Active scripting risk)

JSON Data File

Metadata specs for JSON APIs and configuration files.

Input
json
Output
MIME Type: application/json
Category: Application
Browser Behavior: Displays as raw text structure or triggers parser parsing
Magic Bytes: 7B (character '{')
Security status: Safe

Frequently Asked Questions

Are files uploaded to your server when I run the Magic Bytes Upload Validator?
No. The file validator runs strictly inside your browser using File.slice(0, 16) and FileReader.readAsArrayBuffer() to read only the first 16 bytes of the selected file locally, so your full file payload is never transmitted over the network.
Why does checking magic bytes catch spoofed uploads that filename validation misses?
Renaming a Windows executable from payload.exe to avatar.png fools extension checks and often tricks the browser's reported File.type. Inspecting the leading binary signature reveals the MZ executable header (4D 5A) instead of the PNG signature (89 50 4E 47 0D 0A 1A 0A).
What does the X-Content-Type-Options: nosniff header actually prevent?
Without nosniff, browsers may ignore an ambiguous Content-Type such as text/plain and sniff the response body under WHATWG rules, promoting an uploaded file into text/html or text/javascript and enabling stored cross-site scripting (XSS).
Why should JavaScript files use text/javascript instead of application/javascript?
RFC 9239 formally obsoleted application/javascript and standardized text/javascript as the canonical media type for JavaScript and ES modules (.js and .mjs), matching long-standing HTML specification behavior.
How does the Remote URL Header Inspector work without failing on browser CORS limits?
To inspect public URLs across origins, the URL Inspector sends a lightweight server-side HEAD request (falling back to GET if HEAD is rejected) while enforcing DNS-level SSRF checks that block private RFC 1918, loopback, and link-local IP ranges.

Key Features

  • Instant extension-to-MIME and MIME-to-extension lookup with official media types, legacy aliases, browser rendering behavior, and risk profiles
  • Client-side binary Magic Bytes Upload Validator reading the first 16 bytes in hex and ASCII to detect extension spoofing and corrupted headers
  • Offset-aware container signature matching for RIFF formats (WebP, WAV, AVI) at bytes 8-11 and ISO Base Media MP4 ftyp boxes at bytes 4-7
  • Remote URL Content-Type auditor inspecting HTTP status, charset, Content-Disposition, Content-Encoding, Cache-Control, and X-Content-Type-Options
  • Interactive Extension vs. Content-Type comparator diagnosing browser breakage under strict nosniff enforcement
  • Searchable, category-filtered media type database with one-click JSON and plain-text diagnostic report exports

Common Use Cases

  • Auditing production CDN assets and S3 buckets to confirm missing X-Content-Type-Options: nosniff headers or wrong Content-Type responses
  • Verifying suspicious user-submitted files locally by checking raw hex magic bytes before opening them or tuning backend upload allowlists
  • Debugging why a browser downloads a PDF, SVG, or WebAssembly module instead of rendering or executing it inline
  • Checking whether a legacy alias such as application/x-javascript or image/jpg conflicts with strict browser module loading
  • Documenting HTTP header misconfigurations as downloadable JSON or TXT diagnostic reports for DevOps and security tickets
  • Confirming exact IANA media type strings before configuring NGINX mime.types, Apache AddType rules, or REST API Accept headers

Explore More Tools in This Category

View All Developer & Utility Tools

LLM Token & API Cost Calculator

Estimate BPE token counts, input/output API spend, prompt caching ROI, and RAG context budgets across Gemini 2.5, GPT-4o, GPT-4.1, Claude 4, and DeepSeek models.

Cron Expression Generator & Schedule Tester

Generate, decode, and validate 5-field POSIX cron expressions for Linux, Kubernetes, GitHub Actions, and Vercel, with live previews of upcoming UTC and local execution timestamps.

Unix Timestamp & Epoch Converter

Convert between 10-digit seconds, 13-digit millisecond, microsecond, and nanosecond Unix epochs and ISO 8601 dates, inspect JWT exp/iat timestamps, and test Year 2038 boundaries.

Number Base Converter (Binary, Octal, Decimal, Hex)

Translate arbitrary-precision integers across Binary, Octal, Decimal, Hexadecimal, and Base 36 with exact BigInt arithmetic.

cURL to JavaScript Fetch & Python Converter

Convert raw cURL CLI commands into production-ready ES2024 async/await fetch() and Python requests snippets in one click.

Meta Tag Generator & SEO Simulator

Generate standards-compliant HTML meta tags, Open Graph and Twitter Card markup, hreflang clusters, PWA headers, and JSON-LD structured data with real-time SERP and social snippet previews.

Open Graph Generator & Social Previewer

Design, validate, and preview Open Graph (OG) metadata across Facebook, LinkedIn, Discord, Slack, WhatsApp, Telegram, and iMessage with local image dimension and payload analysis.

Twitter Card Generator & X Social Preview

Generate standards-compliant X (Twitter) Card meta tags for Summary, Summary Large Image, App, and Player formats with desktop/mobile previews, Open Graph sync, and live quality scoring.