Utilo

JPEG MIME Type – Free, Online, Private

image/jpeg is the type for a JPEG image. .jpeg is the four-letter spelling of the extension.

What .jpeg is

The .jpeg extension is the same JPEG file as .jpg with a longer suffix. macOS and many design tools prefer the four-letter form. The container is a sequence of markers. SOF0 marks a baseline scan and SOF2 marks progressive. You do not need a different Content-Type for those. EXIF orientation is a number in the APP1 segment, not a pixel rotation, until a viewer applies it. This page exists so a search for the four-letter extension lands on the registered type instead of on image/pjpeg, which was an old progressive alias and is not what you should send.

IANA registers image/jpeg in RFC 2046. The media type is image/jpeg. Extensions that use it on this page: .jpeg. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.

What sends image/jpeg

What sends image/jpeg: Map .jpeg to image/jpeg in the same types entry that maps .jpg. Sending two different types for the two spellings splits caches and breaks a strict allow-list. When an upload form accepts both, store one extension and keep the original filename only in Content-Disposition if a person needs to see it. Range requests work on JPEG the way they work on any static file. They do not let a viewer decode a slice, because the entropy scan is not independently addressed the way a video keyframe is. The file on disk is still .jpeg. Once the response exists, a client trusts image/jpeg, not the filename. If both spellings are public, pick a canonical one and 301 the other. A 200 for each spelling with the same bytes and no canonical link is how image search indexes the photograph twice. The type stays image/jpeg on both the redirect target and the canonical response. Do not put the type on the 301. A redirect has no image body.

Content-Type for .jpeg

Send image/jpeg and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.

Content-TypeContent-Type: image/jpeg

nginx, Apache, and Express

These snippets map .jpeg to image/jpeg. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .jpeg so a stale mime database in the framework cannot disagree with the type on this page.

nginx# /etc/nginx/mime.types, inside the types { } block
image/jpeg                  jpeg;
ApacheAddType image/jpeg .jpeg
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".jpeg")) {
      res.setHeader("Content-Type", "image/jpeg");
    }
  },
}));

Pitfalls for image/jpeg

Pitfalls that show up for image/jpeg, and not for a neighboring type with a similar extension: A rewrite rule that captures the extension (jpg|jpeg) and then hard-codes image/jpg undoes the types file. Test both URLs. Another trap is the COM comment marker holding a copyright string that a minifier treats as text and re-encodes from Latin-1 to UTF-8, which shifts every later marker and destroys the picture. Treat the file as binary in every pipeline. A third trap is assuming the file has no executable behavior. JPEG itself does not run script, but a polyglot that is also HTML will, if you serve it as text/html. Send image/jpeg and nosniff.

  • image/pjpeg is not the current type for progressive JPEG. Use image/jpeg.
  • A file named .JPEG in a case-sensitive URL is a different path from .jpeg on Linux. The type is the same if you map both.
  • Thumbnail images inside EXIF are nested JPEGs. They are not a second response and do not get their own header.
  • Lossless JPEG is rare and is still a JPEG marker layout. Confirm the SOF marker before you promise baseline quality.

Frequently asked questions

Which spelling should the URL use?

.jpg is more common. Either is correct if the type is image/jpeg and one of them is canonical.

Is progressive a different MIME type?

No. Baseline and progressive are both image/jpeg. The SOF marker tells the decoder which one it is.

Does the header need a charset?

No. JPEG is binary.

What if the file is actually HEIC?

Do not send image/jpeg. HEIC is image/heic. Phones capture HEIC and some exports rename the file without converting it.