What is the MIME type of .jpeg files?
The MIME type (media type) for JPEG image files with the .jpeg extension is image/jpeg. The same type is used for .jpg. Identical to .jpg. image/jpg is not a registered type and some strict clients reject it.
Content-Type header
Content-Type: image/jpeg
Server configuration
| Server | Configuration |
|---|---|
Nginx (mime.types or types {}) | image/jpeg jpeg; |
Apache (.htaccess) | AddType image/jpeg .jpeg |
IIS (web.config) | <mimeMap fileExtension=".jpeg" mimeType="image/jpeg" /> |
| Node.js / Express | res.type('jpeg') or res.setHeader('Content-Type', 'image/jpeg') |
| Amazon S3 | Set Content-Type: image/jpeg on the object (metadata), or pass --content-type image/jpeg to aws s3 cp |
Should .jpeg files be compressed?
No. JPEG image files are already compressed internally, so gzip or Brotli would waste CPU and barely reduce — sometimes even increase — the size. Leave image/jpeg out of your compression configuration.
Why the MIME type matters
Browsers decide what to do with a response — render, run, play or download — from the Content-Type header, not the file extension. With X-Content-Type-Options: nosniff, a wrong type causes stylesheets and scripts to be blocked outright. For uploads, never trust the type sent by the client; check the file’s content (its magic bytes) on the server.
Frequently asked questions
What is the MIME type for .jpeg?
image/jpeg.How do I set the Content-Type for .jpeg in Nginx?
image/jpeg jpeg; is listed in the types block (usually in /etc/nginx/mime.types) and reload Nginx.