Design glossaryJPEG is a lossy image format for photographs. It keeps files small by discarding detail the eye barely notices, but does not support transparency.
JPEG, named after the Joint Photographic Experts Group that created the standard in the early 1990s, is the most common format for photos on the web and in cameras. The files end in .jpg or .jpeg; the two extensions mean exactly the same thing.
JPEG is built for continuous-tone images, where colors blend smoothly, and it is very good at making them small. It does that with lossy compression: some image data is thrown away for good when the file is saved.
How JPEG compression works
The encoder splits the image into small blocks, usually 8 by 8 pixels, and converts each block into a set of frequencies, from broad areas of tone to fine detail. Fine detail and subtle color differences that the eye barely notices are stored with less precision or dropped. Color is often stored at a lower resolution than brightness, because people are more sensitive to changes in brightness.
The quality setting controls how much is discarded. At high quality the losses are invisible; push it too low and the artifacts appear:
- Blockiness in smooth areas such as skies.
- Ringing or fuzz around sharp edges, which is why text, logos, and screenshots look bad as JPEGs.
- Generation loss: every time a JPEG is edited and saved again, a little more is lost. Keep an original and export new JPEGs from it.
When to use JPEG
- Use it for photographs and other complex, realistic images.
- Avoid it for logos, icons, and graphics with text or flat color, where PNG or SVG stay crisp. JPEG has no transparency and no animation.
- Consider newer formats. WebP and AVIF usually produce noticeably smaller files at the same visible quality and are supported by all current major browsers. JPEG remains the safe choice where compatibility matters most, such as email and social sharing images.
JPEGs in WordPress
- Resize before uploading. A camera original can be several thousand pixels wide. WordPress scales very large uploads down and generates smaller copies for its responsive
srcset, but a sensible upload size, around twice the largest display width, keeps the Media Library lean. - Know the default quality. WordPress saves its resized copies at a quality of 82 out of 100. Developers can change that with the
wp_editor_set_qualityfilter. - Compress the originals. An image optimization plugin or a pre-upload tool can cut file size further without visible loss. In our experience a quality in the mid-70s to low 80s looks identical to the original for most photos, but check by eye.
- Name and describe images. A descriptive file name and useful alt text help search engines understand the image, and the alt text is what screen reader users hear.
Large hero photos are often the Largest Contentful Paint element, so getting their size and compression right has a direct effect on Core Web Vitals.