What is JPG (JPEG)?

Learn everything about JPG/JPEG format - how it works, compression settings, pros and cons, and when to use it. The definitive JPG format guide.

The JPG image format explained: how it works, its specs, and when to use it.

JPG

What is JPG (JPEG)?

1992 Year CreatedLossy Compression Type#1 Most Used Image Format

JPG (also written as JPEG - Joint Photographic Experts Group) is a lossy image compression format created in 1992. It is the most widely used image format on the internet, in digital cameras, and on smartphones worldwide.

The format works by discarding image data that the human eye is least likely to notice, achieving dramatic file size reductions. A high-quality JPEG can be 10x smaller than an uncompressed version of the same image with virtually no visible quality loss.

How JPG Compression Works

JPG (also written JPEG, after the Joint Photographic Experts Group that created it) is the world's most common image format, and it earned that place by being extremely good at one thing: making photographs small. It does this through lossy compression, deliberately discarding image detail that the human eye is unlikely to notice in order to dramatically shrink the file. A photo saved as JPG is often a tenth the size of the same image as PNG, with no visible difference at sensible quality settings.

The compression exploits the limits of human vision. It works by converting the image into frequency information (using a mathematical operation called the discrete cosine transform), then throwing away the high-frequency detail our eyes are least sensitive to, particularly fine color variation, since people notice changes in brightness far more than changes in color. The remaining data is then packed efficiently. This is why JPG is brilliant for photos, which are full of smooth gradients and subtle tones, and poor for sharp-edged graphics, where discarding high-frequency detail produces visible smearing.

A quality setting (typically 0 to 100) controls how aggressively JPG discards data. At high quality (around 85 to 95) the loss is invisible; as you lower it, the file shrinks further but artifacts appear: blocky 8x8 squares, halos around sharp edges, and a general softening. The practical sweet spot for most photos is 80 to 90, small files with no obvious degradation.

The Generation Loss Trap

The single most important thing to understand about JPG is that its loss is permanent and cumulative. Every time you open a JPG, edit it, and save it again as JPG, the lossy compression runs again and discards a little more detail, a problem called generation loss. Save the same JPG a dozen times and it visibly degrades, even at high quality. This is why JPG should be a final delivery format, not a working format. For editing, keep a lossless master (PNG, TIFF, or your camera's RAW file) and export a fresh JPG each time, rather than repeatedly re-saving the same JPG.

History and Variants

The JPEG standard was published in 1992 and quickly became the default for digital photography and the web, a position it has held for three decades thanks to universal support and excellent compression of photographic content. The .jpg and .jpeg extensions refer to the same format; the shorter .jpg exists because older Windows systems limited extensions to three characters.

JPG also defines a progressive mode, where the image loads as a low-resolution version that sharpens as more data arrives, useful on slow connections. JPG files usually carry rich EXIF metadata, the camera settings, date, and GPS location embedded by digital cameras and phones, which is one reason it remains the standard for photography. Newer formats like WebP and AVIF compress better, but none has displaced JPG's universal compatibility.

JPG vs PNG vs WebP

The rule of thumb is simple. Use JPG for photographs and any image that is mostly smooth tones and gradients. Use PNG for screenshots, logos, text, line art, and transparency, where JPG's lossy compression would smear sharp edges and where you need a transparent background (which JPG cannot do at all). For the web, WebP is the modern upgrade: it compresses photos smaller than JPG at the same quality and adds transparency, so where browser support allows it can replace JPG with smaller files. JPG's enduring advantage is that it works absolutely everywhere, with no compatibility questions.

JPG vs Other Image Formats

FeatureJPGPNGWebPAVIF
CompressionLossy (DCT)[1]LosslessLossy & losslessLossy & lossless
TransparencyNone[2]Full alphaFull alphaFull alpha
Color depth8-bit/channelUp to 16-bit8-bitUp to 12-bit (HDR)
Compression efficiencyBaselineLarger files~25-34% smaller than JPGSmallest
Browser supportUniversal[1]UniversalAll modern browsersMost modern browsers
Best forPhotographsLogos, screenshotsModern web imagesHigh-efficiency web/HDR

JPG remains the universal default for photographs; newer formats like WebP and AVIF achieve smaller files at similar quality but with narrower (though now broad) support.

Pros & Cons of JPG

Advantages

Small File Sizes | FileFormer, Dramatic compression with minimal visible quality loss - up to 10x smaller than uncompressed.

Universal Support | FileFormer, Supported by every browser, device, camera, and operating system in existence.

Adjustable Quality | FileFormer, Quality setting 1 to 100 gives full control over the size vs quality trade-off.

Ideal for Photos | FileFormer, Perfect for photographs and complex images with millions of colors and gradients.

Disadvantages

Lossy Compression | FileFormer, Each save re-compresses the image causing gradual quality degradation over time.

No Transparency | FileFormer, Does not support alpha channel - transparent areas are filled with white.

Compression Artifacts | FileFormer, Blocky artifacts appear at low quality settings especially around sharp edges.

Bad for Graphics | FileFormer, Not suitable for text, logos, or flat-color graphics - use PNG or SVG instead.

Technical Specifications

Developer
Joint Photographic Experts Group[1]
File Extension
.jpg / .jpeg[1]
MIME Type
image/jpeg[1]
Compression
Lossy (DCT-based)[1]
Color Depth
24-bit (16.7M colors)[1]
Transparency
Not supported[1]

When to Use JPG

JPG is the right choice for most photographic content and anywhere file size is a priority.

Photography | FileFormer

Digital cameras and smartphones save photos as JPG by default. Perfect for portraits, landscapes, and natural scenes.

Web Images | FileFormer

Smaller file sizes mean faster page loads. Use JPG for all photographic web content.

Social Media | FileFormer

Most social platforms re-compress uploads to JPG. Upload as JPG for predictable quality control.

Email & Sharing | FileFormer

Small JPG files are easy to share via email and messaging apps without hitting size limits.

Frequently Asked Questions

What is the difference between JPG and JPEG?

There is no difference - they are the same format. JPG became common because early Windows limited extensions to 3 characters.

Does saving a JPG multiple times reduce quality?

Yes. Each save re-applies lossy compression causing gradual degradation. Keep originals in PNG and export to JPG only as a final step.

What quality setting should I use for JPG?

For web use quality 70 to 80 is ideal. For print use 85 to 95. Quality above 95 rarely makes a visible difference but significantly increases file size.

Can JPG files have a transparent background?

No. JPG does not support transparency. Use PNG, WebP, or SVG instead. JPG fills transparent areas with white by default.

Is JPG or PNG better for web images?

For photographs JPG is smaller. For graphics and text PNG is better. For modern web use, WebP outperforms both.

References

  1. JPEG standard (ISO/IEC 10918) - JPEG Committee
  2. JPEG image type - MDN Web Docs
  3. JPEG File Interchange Format Family - Library of Congress
  4. JPEG - Wikipedia