What Is JPEG (JPG)? How the Format That Compressed the Internet Really Works
Almost every photo on your phone, in your messenger app and on any website is a JPEG. The format is over thirty years old, yet it is still the king of digital snapshots. Let's break it down without the formulas or the jargon: what JPEG is, how it manages to squeeze a photo dozens of times smaller, what it fundamentally cannot do — and why that still doesn't stop it from being everywhere.
What JPEG is in plain English
JPEG is the world's most common way to store photographs. Its job almost sounds like a magic trick: make a photo file dozens of times smaller, yet do it so the eye barely notices the catch. That's why a 12-megapixel photo doesn't weigh 36 megabytes "as is" but two or three — JPEG squeezed it.
The secret is that JPEG is a lossy format. It doesn't try to preserve the image pixel for pixel. Instead, it calmly throws away the parts of the information the human eye can barely tell apart anyway, and keeps what matters. The result is a trade: a little less precision in exchange for a radically smaller file.
And one detail that trips up newcomers: JPG and JPEG are the same thing. Old versions of Windows and DOS allowed only three letters in a file extension, so JPEG got shortened to JPG. There is no difference between .jpg and .jpeg — both open and behave identically.
In short
JPEG is a format for photographs that sacrifices a tiny fraction of detail for a huge saving in space. It is brilliant for pictures with smooth color gradients and poor wherever you need perfect sharpness: text, logos, transparency.
Where the format came from: 1992 and one committee
The acronym JPEG stands for Joint Photographic Experts Group. It's not the name of a program but the name of a committee: an international working group under the ISO and (back then) CCITT organizations, which in the late 1980s took on a problem that seemed almost impossible.
The goal was this: invent a single compression standard for full-color and black-and-white photographs that would work the same way for everyone. Until then, each manufacturer cobbled together its own format, and a photo from one device might simply refuse to open on another. The result of the work was a standard officially approved in 1992 (formally, ISO/IEC 10918-1).
JPEG's arrival lined up perfectly with the birth of the mass internet. Pictures finally became light enough to send over the slow modems of the era. Without a format that shrinks photos dozens of times, the early photographic web would have been painfully slow. In that sense JPEG is one of the formats that made the internet visual.
The main trick: lossy compression and the DCT
How exactly does JPEG throw away the "excess" without turning a photo into mush? Stripped of the math, the whole process rests on one idea: people notice large, smooth changes in brightness well and tiny, sharp details poorly. JPEG exploits precisely this.
The photo is mentally sliced into small squares of 8×8 pixels. JPEG describes each square not as individual dots but as a set of "waves" — from the smoothest fill to the finest ripple. This step is called the discrete cosine transform (DCT). It sounds intimidating, but the idea is simple: a block is expressed as a mix of coarse and fine patterns.
Next comes the cleverest step, quantization. JPEG coarsens the description: it keeps the large, smooth patterns accurately, while the fine ripple — which the eye barely sees anyway — gets rounded crudely or zeroed out entirely. How much to round is set by a quantization table. This is exactly where the data loss happens. In the final step, what remains is packed losslessly with ordinary entropy coding (Huffman codes) — this part is honest compression, with nothing thrown away.
Split into blocks
The image is divided into 8×8-pixel squares and converted into a color space where brightness is separated from color.
DCT and quantization
Each block is broken into "waves," then the small, barely visible details are rounded off crudely. This is where information is lost.
Pack it down
The remaining data is compressed losslessly with Huffman codes. The file is ready — and far lighter than the original.
"Quality" and the clever color shortcut
When you save a JPEG, the program asks for a "quality" value — usually a number from 0 to 100. That slider essentially controls the rounding in the quantization step. Set it to 95 and the rounding is gentle, with almost no loss, but the file is larger. Set it to 40 and the file becomes tiny, but characteristic blocks and halos appear along edges. For most photographs the sweet spot is around 80–90: nearly impossible to tell apart from the original by eye, yet already modest in size.
There's a second trick JPEG applies even before quantization — chroma subsampling. The eye is far more sensitive to brightness than to hue. So JPEG stores brightness at full resolution but often records color information four times more coarsely — in a mode written as 4:2:0. This is almost invisible in photographs and on its own roughly halves the file.
Careful with re-saving
JPEG's losses are irreversible. Every time you open a JPEG, edit it and save again, the format rounds the data anew — and the picture gradually degrades. This is called generation loss. If you plan to edit a file many times, keep the original in a lossless format and export to JPEG only for the final version.
Why those distortions look the way they do at low quality, and how to fight them, is a big topic of its own. We cover it in why JPEG loses quality and what artifacts are, and the practical ways to cut file size with no visible loss are in the guide on how to compress a JPG.
What JPEG can't do
JPEG is tuned for one job — photographs — and excels at it. But that's exactly why there are things beyond its reach. These aren't flaws, just the limits of what it was built for.
- Transparency. JPEG has no alpha channel. The background is always solid — a logo on a transparent background is impossible in JPEG. For that you need PNG.
- Crisp text and sharp edges. Lossy compression hates high-contrast borders: dirty halos appear around letters and thin lines. A screenshot with text looks noticeably worse as a JPEG than as a PNG.
- Layers and editability. JPEG stores only the finished, "flattened" picture. No layers like a PSD — you can't go back and edit a single element after saving.
- Animation. One file, one frame. For moving pictures there are GIF, APNG and video formats.
| What you need | JPEG | Better choice |
|---|---|---|
| Photos with smooth color | Perfect | JPEG |
| Transparent background | No | PNG |
| Text, logos, graphics | Poor | PNG / SVG |
| Smallest size for the web | So-so | WebP / AVIF |
| Animation | No | GIF / APNG |
What else hides inside a JPG
JPEG stores more than just pixels. A file usually carries metadata that users rarely think about:
- EXIF. The photo's "passport": the camera or phone model, the date and time, shutter speed, aperture, ISO, and sometimes the GPS coordinates of where it was taken. Handy for an archive, but worth remembering for privacy before you publish.
- ICC profile. A description of how to interpret the colors so the shot looks the same on different screens.
- Thumbnail. A small copy for fast previews in your file browser.
It's also worth knowing about two ways of writing the file. Baseline JPEG loads line by line — the classic top-to-bottom curtain. Progressive JPEG first shows a blurry version of the whole image, then gradually sharpens it. On a slow connection the progressive variant feels nicer: you can see what's in the photo before it finishes loading.
Where JPEG is used
It's easier to say where JPEG isn't. But here are the format's main domains:
- Cameras and smartphones. Unless you shoot in RAW, the final shot is almost always saved as a JPEG — the phone processes the photo and hands you a finished, lightweight file.
- The web and social media. Photos in feeds, on sites and in galleries are overwhelmingly JPEG. Lighter files load faster.
- Messengers and email. Send a photo and it almost certainly goes out as a JPEG, often compressed even further.
- Printing and documents. Scans, print-ready photos, images inside office files — JPEG is everywhere as the common denominator.
How to open and convert JPEG
Opening a JPEG is never a problem: every browser, every viewer and every editor understands it — from the default app on your phone to Photoshop. That's the format's superpower: it opens literally everywhere, without installing anything.
What you'll need far more often is conversion — when JPEG's abilities fall short:
- You need transparency or lossless compression (say, for a logo or a screenshot) — convert JPG to PNG.
- You need the smallest size for a website at the same quality — JPG to WebP.
- The picture arrived as PNG or WebP and you want a universal, lightweight photo — PNG to JPG or WebP to JPG.
Convert JPEG right in your browser
Need transparency, a lossless format or a smaller size? The free FormatZ converter handles your JPG in a couple of seconds — no install, no sign-up.
Convert JPG to PNGThe full list of supported conversions is always on the all formats page. And if you want to dig deeper into how JPEG differs from its neighbors and what to pick for photos, see our breakdown of JPG, PNG or WebP for photographs.
Frequently asked questions about JPEG
Read next
TechWhy JPEG Loses Quality: Artifacts Explained
Where the blocks and halos come from — and how to avoid them.
How-toHow to Compress a JPG Without Visible Quality Loss
Cut a photo's size step by step while keeping it sharp.
ComparisonJPG, PNG or WebP for Photographs
Which format to choose for your shots — and why.