JPG (JPEG) Format Explained — The Standard for Photo Compression
JPG (JPEG) explained: the 1992 ITU-T T.81 standard, DCT lossy compression, why no transparency, progressive JPEG, file structure and quality tips.
JPEG takes its name from the committee that created the standard (Joint Photographic Experts Group), and .jpg is the most common file extension. The specification, developed by a committee formed in 1986, was approved as ITU-T Recommendation T.81 in September 1992 and as ISO/IEC 10918-1 in 1994. More than 30 years later, it is still the photo format most widely accepted by digital cameras, smartphones, the web and government upload forms.
How compression works
- RGB colors are converted to luminance (Y) and chrominance (Cb, Cr), and the chroma resolution is commonly halved (chroma subsampling).
- The image is split into 8×8 pixel blocks, and the discrete cosine transform (DCT) extracts their frequency components.
- Each component is divided by a value from the quantization table and rounded. Lowering the quality setting increases these divisors, so more high-frequency detail disappears. This is the step where loss occurs.
- The remaining values are losslessly compressed with Huffman coding.
Because it discards information the human eye is less sensitive to first, differences are hard to see in natural photos even at high compression. On text, lines and solid-color edges, however, blurring (ringing) and 8×8 block artifacts appear around the edges.
File structure, JFIF and EXIF
A JPG file always starts with FF D8 (start of image) and ends with FF D9 (end of image). In between, information such as quantization tables, Huffman tables and image dimensions follows in units called "markers". The beginning of the file usually carries JFIF (APP0 marker) or EXIF (APP1 marker) data; digital cameras and smartphones use EXIF, which stores shooting details and location. This is why you should remove location data before sharing photos (EXIF guide).
Baseline vs. progressive JPEG
T.81 defines both the baseline mode, which draws the image from top to bottom, and the progressive mode, which shows a blurry full image first and sharpens it gradually. For large photos on the web, progressive mode feels faster; when compatibility with older devices or submission systems matters, baseline is safer. The standard also includes a lossless mode, but it is rarely used.
Strengths and limitations
- Compatibility: According to MDN, every major browser has supported it from the start, and virtually every operating system and program opens it.
- Flexible range: A single quality value adjusts file size over a wide range. For photos, quality 70–85 is the most efficient range.
- No transparency: With no alpha channel, it can't store a transparent background.
- Re-save loss: Quantization happens again every time you open and save, so quality degrades little by little.
- 8-bit limit: It struggles with HDR or wide tonal ranges, and smooth gradients like skies can show banding.
Main uses
When you don't know what the recipient will use — sharing photos, submitting application or ID photos, email attachments, sending files to a print shop — JPG is the safest choice. PNG is better suited to screenshots, logos and charts.
Converting to other formats
- JPG → PNG: No additional loss, but lost information doesn't come back and the file usually grows several times larger. Converting JPG to PNG only makes sense when you'll edit repeatedly or add transparent areas.
- JPG → WebP/AVIF: Loss is added on top of loss, but at a reasonable quality you can cut the size substantially (JPG to WebP).
- Other formats → JPG: Transparent areas are filled with a solid color such as white, and color information of 10 bits or more is reduced to 8 bits.
- EXIF orientation: Smartphone JPGs often store rotation in EXIF. If a conversion tool doesn't apply it, the photo may appear sideways.
To learn how to hit a target KB, see how image compression works.