What is the JPEG file format?
.jpeg is one of the most popular graphic formats currently in use. It uses a lossy compression algorithm designed by the Joint Photographic Experts Group. .jpeg files hold digital image data and computer graphics, and each file contains embedded metadata covering color space, color profile, and image dimensions.
JPEG and JPG
The .jpg extension is interchangeable with .jpeg - both identify byte-for-byte the same format. The shorter .jpg name arose solely from the old DOS/Windows three-character extension limit.
JPEG compression method
JPEG uses a lossy compression algorithm, meaning some image information is discarded and cannot be recovered. Although this method significantly reduces file size, it comes at the cost of lower image quality. Still, JPEG offers acceptable image quality despite drastic reduction of file size. Users can choose the compression level when saving an image as .jpeg to achieve the desired quality-to-size balance.
JPEG format specification
A .jpeg file stores up to 24 bits of data per pixel, supporting over 16 million colors - a full-color palette. The format is divided into two main sub-formats: *JPEG/Exif* (used in digital photography by cameras and smartphones) and *JPEG/JFIF* (the internet standard). Every .jpeg file begins with the magic bytes FF D8 FF and ends with FF D9 (the EOI marker), uniquely identifying it regardless of whether .jpeg or .jpg appears as the extension. The format does not support transparency; for images requiring an alpha channel, formats such as PNG or WebP are better suited.
Security & safety
RISK: LOWJPEG is a passive data format - it cannot execute code, so a normal photo is safe to open. Two caveats worth knowing: (1) Exif metadata can embed GPS coordinates and camera info, so photos shared publicly may leak your location - strip Exif before posting if that matters. (2) Historically, a handful of image-parser vulnerabilities (e.g. the 2004 Windows GDI+ JPEG flaw) let crafted JPEGs exploit unpatched viewers; keep your OS/viewer updated. A file claiming to be a 'photo.jpeg' that is actually 'photo.jpeg.exe' is the real danger - check the true extension.
Format details
in a nutshellPrograms that open JPEG files
Technical details
deep spec| Compression type | Lossy DCT (Discrete Cosine Transform) |
| Color depth | Up to 24 bits per pixel (8 bits per channel) |
| Color space support | YCbCr (primary), RGB, CMYK, grayscale |
| Chroma subsampling | 4:4:4, 4:2:2, or 4:2:0 (4:2:0 most common for web) |
| Transparency | Not supported - no alpha channel |
| Sub-formats | JFIF (internet/web standard) and Exif (digital cameras and smartphones) |
| File signature (magic bytes) | FF D8 FF at offset 0 (SOI marker); file ends with FF D9 (EOI marker) |
| MIME type | image/jpeg |
| Maximum image size | 65,535 × 65,535 pixels (per ISO/IEC 10918-1 standard) |
| Metadata standards | Exif, IPTC-IIM, and XMP embedded in APP marker segments |
| Progressive encoding | Supported - progressive JPEGs load in increasing detail passes, improving perceived web performance |
| ICC color profiles | Supported via APP2 marker segment |
| Compression ratio | Typically 10:1 to 20:1 at standard quality settings; adjustable by the user |
| Common quality range | Quality 75-85 (on a 0-100 scale) balances file size and visual fidelity for most use cases |
| Released | 1992 (JPEG standard, ISO/IEC 10918-1); JFIF interchange format 1992 |
| Open standard | Yes · royalty-free |
| Specification | www.w3.org |
JPEG conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about JPEG files.