Skip to content
All Tools

Developer JPG · PNG · WebP · AVIF · GIF · SVG 100% local

Content-Type Checker

Check the Content-Type of an image file and the correct header value to serve it with.

Runs in your browser — your image never leaves your device Updated September 2026

Processed directly in your browser. Your image never leaves your device.

About this tool

The Content Type Checker reveals the exact HTTP Content-Type header value that an image should carry, derived from the file's real bytes rather than from assumptions about its name. It is built for developers wiring up servers, CDN rules, upload validators and media pipelines where the header string must be byte-for-byte correct.

Content-Type is the header a server sends ahead of a response to tell the client what is coming. When a browser requests a JPEG, the response carries something like Content-Type: image/jpeg, and the consumer decides how to render, decode or save based on that line. A wrong value does not corrupt the file, but it commands every intermediary - browsers, proxies, security scanners, mobile clients - to treat it incorrectly.

The header is only as accurate as its source. Servers usually assemble Content-Type from the file extension using a mapping table, so a mislabeled file inherits its label's header regardless of its true content. This tool cuts around that by sniffing the signature in the leading bytes and returning the header string that belongs to what the file actually is.

The output is deliberate about spelling: the returned value is the canonical image/jpeg, not the informal image/jpg. That distinction matters because header strings are compared literally in browsers and validators, and a variant no validator recognizes behaves like no header at all. Every returned string is copy-ready for configuration.

Use it when configuring an origin server or CDN, when debugging a browser that downloads a file instead of rendering it, when a strict upload validator rejects valid-looking images, and whenever you are about to write a Content-Type into a config table and want the exact registered value. It supports the core web display formats - JPG, PNG, WebP, AVIF, GIF and SVG.

Nothing is uploaded and nothing is modified. The file is read locally for a quick signature check, the header string is produced, and the original stays exactly as you found it. The bottleneck in the entire flow is your own decision about where to paste the resulting value.

How to use Content-Type Checker

  1. Drop or select an image file.

  2. The tool detects the format and produces the correct Content-Type header value.

  3. Copy the header string for use in your server config, CDN rules, or .htaccess file.

What this tool does

  • Header value for CDN/server config.

Specifications

Input formats JPG, PNG, WebP, AVIF, GIF, SVG
Processing Local browser (Canvas API)
Uploads None — files stay on your device
Max file size 25 MB per file
Original file Never modified
Supported formats JPG, PNG, WebP, AVIF, GIF, SVG
Output Copy-ready Content-Type header value
Use case Server, CDN, and .htaccess configuration

In-depth Guide

Standard header values this checker returns

Each supported format wires to one canonical header value-complete with the Content-Type: prefix ready for a config line or a test. The mapping below is the common ground between browser expectations and server practice, aligned to the registered MIME strings for each format.

Notice the corrections baked into the table. The base UTF-8 image/svg+xml stands in for charset-laden variants, and image/jpeg is used rather than image/jpg - both choices exist so the string you copy is the one a conforming client expects.

Actual content Content-Type header value Copy-ready form
JPEG image/jpeg Content-Type: image/jpeg
PNG image/png Content-Type: image/png
WebP image/webp Content-Type: image/webp
AVIF image/avif Content-Type: image/avif
GIF image/gif Content-Type: image/gif
SVG image/svg+xml Content-Type: image/svg+xml

Why similar spellings and variants trip validators

Header comparison is literal: image/jpg and image/jpeg are different strings even though they describe the same family of files. When a validator, CDN or mobile client matches against a fixed set that contains only image/jpeg, a header announcing image/jpg simply is not recognized, and the response falls back to whatever behavior a missing match allows - often a forced download or a refusal to render.

The same literal-comparison trap awaits charset variants. A header written as image/svg+xml; charset=utf-8 is not equal to image/svg+xml, and split-again parsers may not reassemble them. Shipping one canonical value and one only is the reliable path, which is why this tool always returns the bare registered string.

Header a server might send Correct or problematic
Content-Type: image/jpeg Correct canonical value
Content-Type: image/jpg Wrong variant; not recognized everywhere
Content-Type: image/svg+xml Correct canonical value
Content-Type: text/svg Wrong type family; SVG clients may reject
Content-Type: image/pjpeg Legacy variant; inconsistent decoding
Content-Type: image/png Correct canonical value

When a bad header breaks otherwise valid images

The failure mode is central to why this tool exists: the file can be flawless while the header makes it unusable. A browser that receives image/png for a PNG that is actually decoded fine still misbehaves if the header mismatch trips sniffing protections, forces a download dialog, or makes a strict origin refuse to process the response.

The classic symptoms below all share an innocent-looking file and a wrong transport label. Running the content type check puts the name and the bytes back in agreement so the transport disappears as a variable.

  • A JPEG served as image/jpg triggers a download dialog instead of an inline render.
  • A PNG served with application/octet-stream is treated as an opaque download.
  • An SVG served without image/svg+xml opens in a text viewer or is rejected outright.
  • A mislabeled JPEG (named .png) inherits image/png and confuses every decoder.
  • A WebP served with the wrong header forces clients into sniffing or failure.

Header detection versus the file name

Most servers build Content-Type from an extension mapping: .jpg becomes image/jpeg, .png becomes image/png, and so on. That is cheap and deterministic, but the mechanism cannot notice when the name lied. A photo.jpg that is actually PNG is served as image/jpeg with absolute confidence in the config table.

Byte-based detection starts from the other side. The leading signature resolves the true format, and the header is chosen from the format's canonical value. The result is that the header follows the content, not the name - which is the property you want when the goal is accurate responses.

Using the header value in server configuration

The most common destination for the returned value is a header rule: a static file handler, a CDN rule, or an upload validator that expects a declared type. Where this value should land depends on the layer doing the serving, but the copy-ready line works almost anywhere you paste it verbatim.

A deliberately small support set - the modern web display formats - keeps the mapping unambiguous. JPG, PNG, WebP, AVIF, GIF and SVG cover the overwhelming majority of production image traffic, and each one maps to exactly one header value with no ambiguity.

  • Static file servers: define the extension-to-header mapping using these values.
  • Upload validators: compare the declared header against the signature result.
  • CDN rules: normalize the origin header to the canonical value before caching.
  • Test suites: assert the response header equals the expected string.

What this checker intentionally does not do

Scope discipline keeps the output trustworthy. This tool returns the header value for the supported formats and stops there: it does not evaluate image quality, does not validate pixel data, and does not police the correctness of remote servers. Its read is local signature detection plus a strict mapping.

If your need is broader format identity - TIFF, BMP, ICO, or the sort of mystery file that belongs in a forensic pass - the MIME Type Checker and the Image Format Checker cover the wider table. Keep this tool for the focused job it names in its title.

How it works

Header value generation

The tool detects the image format from its byte signature and returns the exact Content-Type value that should appear in the HTTP response header when serving that file. This is the value your web server or CDN needs to send.

MIME vs. Content-Type

A MIME type like image/png is the base identifier. The Content-Type header may also include charset or other parameters. This tool outputs the full, copy-ready string suitable for server configuration.

Example result

Before After
Input file: photo.jpg (2.1 MB)
File signature: JPEG (FF D8 FF)
Content-Type header: image/jpeg
Where to use it: Server config, CDN origin settings, .htaccess

The header value depends on the file you drop. The example uses a JPEG.

Pro tips

Copy the whole header line

The value returned is deliberately copy-ready with the Content-Type: prefix. Dropping the prefix is fine for mapping tables, but when you are testing responses, the full line is what your assertions should compare against.

Use image/jpeg, never image/jpg

Registered MIME strings use jpeg in full. Shortened variants are accepted by some clients and ignored by others, so the canonical spelling is the only value worth putting in a config file.

Check after every upload rule change

Validators and CDN rules evolve. After editing a header rule, re-run the check on a known-good file so you confirm the new rule still maps to the canonical value.

Diagnose downloads with it first

A file that downloads instead of rendering is the classic header bug. Checking the header string takes seconds and either confirms the bug or clears the transport layer entirely.

Keep headers and names in one practice

Correct headers and correct extensions are the same discipline from two angles. Fix both when the checker reports a mismatch, so the file looks right to the server and to every decoder.

Regularize SVG output

Some editors emit image/svg+xml with parameters such as charset. For consistency, prefer the bare value from this checker so every consumer sees the same string.

When to use it

Great for Content-Type Checker

  • Configuring correct Content-Type headers on an Nginx or Apache server for uploaded images.
  • Setting up CDN origin or edge rules so images serve with the right MIME type.
  • Writing .htaccess or httpd.conf directives for a specific image format.
  • Troubleshooting browser rendering issues caused by incorrect Content-Type headers.

Watch out for

  • Use the MIME Type Checker if you only need the raw MIME type string without header context.
  • Use the Image Format Checker for a deeper format-level analysis beyond header values.

Privacy

This tool runs entirely in your browser using the Canvas API. Your image is never transmitted — there is no upload endpoint involved. Clearing the page removes the file from memory.

No file is uploaded. Detection and header generation happen entirely in the browser.

Edits never overwrite your original file. Every result is a new download, so you always keep the source image. Read the privacy policy.

Troubleshooting

If the header does not match the actual file bytes, the browser may still fail. Verify both the header value (from this tool) and the file signature (from the MIME Type Checker).

Yes. image/jpeg is the correct IANA-registered type. image/jpg is not standard and may cause issues with strict parsers or CDNs.

Frequently asked questions

The Content-Type header is derived from the MIME type but may include additional parameters. This tool gives you the full, server-ready value, not just the base type.

Yes. The output is formatted to be pasted directly into AddType, AddDefaultCharset, or CDN header configuration without modification.

The MIME type names what a file is, such as image/jpeg. Content-Type is the HTTP header that carries that value (or a mistaken one) from a server to a client for a specific response. This tool renders the header line; the MIME Type Checker renders the bare type.

Header matching is literal. image/jpg is not the registered value, so anything that compares against a fixed set of registered strings treats it as unknown. The failure rate varies by client, which is exactly why the canonical spelling is the safe one.

Yes. The header only describes the transport. A valid header on a corrupted file still yields a corrupted render. Fix the file, then confirm the header separately - both layers have to be right.

Its scope is the modern web display set, which keeps the mapping small and unambiguous. For TIFF, BMP or ICO headers, consult the MIME Type Checker or the Image Format Checker.

Wherever your stack emits responses: static-file handlers, CDN configurations, upload validators or test assertions. Each environment consumes the value in its own syntax, but the string itself stays identical.

Not for the result. Caches store bytes and headers; a cached copy inherits whatever header it was given. Re-checking the source file is what tells you whether the cached value was right all along.

Technical details

Header format Standard HTTP Content-Type value (e.g. image/png)
Detection method File signature + format mapping
Output characters ASCII only, safe for all server configs

Tool last updated: September 2026. Browse all image tools.