image/jpeg MIME Type — JPEG Content-Type & Image Serving Guide
Joint Photographic Experts Group format. A lossy compression format optimised for photographs and natural images. Supports up to 24-bit colour (16.7M colours). Does not support transparency. The most widely supported image format on the web.
Used For
- Photographs
- Product images
- Blog post hero images
- Social media preview images
HTTP Header Example
HTTP/1.1 200 OK
Content-Type: image/jpeg
Cache-Control: public, max-age=31536000
Content-Length: 24576
[binary JPEG data]Code Examples
// Express — serve JPEG
app.get('/photos/:id', async (req, res) => {
const photo = await getPhoto(req.params.id)
res
.set('Content-Type', 'image/jpeg')
.set('Cache-Control', 'public, max-age=31536000')
.send(photo.buffer)
})
// Next.js — optimised images via next/image (handles MIME type automatically)
import Image from 'next/image'
<Image src="/photo.jpg" alt="..." width={800} height={600} />Related MIME Types
Frequently Asked Questions
What is the image/jpeg MIME type?
Joint Photographic Experts Group format. A lossy compression format optimised for photographs and natural images. Supports up to 24-bit colour (16.7M colours). Does not support transparency. The most widely supported image format on the web.
When should I set Content-Type: image/jpeg?
Set Content-Type: image/jpeg on HTTP responses that contain JPEG Image data. Photographs.
What file extensions use image/jpeg?
Files with image/jpeg content typically use these extensions: .jpg, .jpeg.
What happens if I serve this with the wrong Content-Type?
Browsers use the Content-Type header to decide how to handle the response. Serving image/jpeg content with an incorrect MIME type can cause browsers to display it incorrectly, refuse to execute it (scripts), or prompt an unintended download. Modern browsers respect X-Content-Type-Options: nosniff and will not attempt to auto-detect the type.
