JPEG is a lossy compression format, and its popularity comes from one trade: it discards image detail humans barely notice so photos shrink to a fraction of their raw size. A typical 12-megapixel photo saved as a JPEG at 85% quality lands around 2–4 MB, while the same shot as an uncompressed 24-bit image takes roughly 36 MB. That gap — often 10:1 or better — explains why JPEG became the default for cameras, phones, and the web.
How JPEG Compression Actually Discards Data
JPEG does not store a photo pixel by pixel. It splits the image into 8×8-pixel blocks, converts each block from RGB color into a brightness channel (luma) and two color channels (chroma), then applies a mathematical transform called the discrete cosine transform. That transform turns the block into a set of frequency values — how much fine detail versus broad shading sits in each block.
The compression happens next. A quantization step divides those frequency values by a table of numbers and rounds the results, and the rounding is where data disappears permanently. High-frequency detail (sharp edges, fine texture) gets divided by larger numbers and often rounds to zero, which is why heavy JPEG compression produces blocky artifacts and smeared detail rather than random noise.
The format also exploits human vision. People resolve brightness far better than color, so JPEG stores chroma at half resolution (the standard "4:2:0" subsampling) with little visible penalty. The Joint Photographic Experts Group, a committee of ISO and IEC, published the standard in 1992, and the core algorithm has not changed since — which is why a JPEG from a 1998 digital camera opens perfectly today.
Decoding reverses the math but cannot recover the rounded values. Each save-and-resave cycle re-quantizes the already-damaged data, so quality degrades generationally. That single fact drives most practical JPEG advice, from camera settings to web workflows.
Why Cameras and Phones Default to JPEG
Every major camera maker and phone manufacturer ships JPEG as the default capture format because it solves three problems at once: storage, speed, and compatibility. A 64 GB memory card holds roughly 16,000 12-megapixel JPEGs at 4 MB each but only about 1,700 uncompressed raw files at 36 MB. Photographers shooting bursts or events rarely want to manage that difference.
Speed matters too. JPEG encoding happens in dedicated camera hardware and finishes in milliseconds, so burst shooting and instant playback stay fluid. Raw formats demand more processing and larger buffers. For a phone snapping a quick photo, JPEG output is ready to share before the shutter sound fades.
Compatibility seals it. The format is supported by essentially every browser, operating system, image editor, printer, and messaging app in existence. When JPEG was standardized in 1992, that universality was the design goal, and three decades of adoption made it self-reinforcing.
The trade-off is real, though. Cameras typically compress at "fine" or "standard" quality settings that correspond to roughly 90–95% and 80–85% quality, and the in-camera processing also applies sharpening and noise reduction you cannot undo. Photographers who need maximum latitude shoot raw alongside JPEG, which is why many cameras offer a "RAW+JPEG" mode that writes both files per shot.
What Happens to File Size When You Lower the Quality Slider
Quality settings in the 70–95% range change file size dramatically while changing visible quality only slightly. Drop from 95% to 85% and a photo might shrink by 40%; drop from 85% to 70% and it may shrink another 40% — but the second step starts showing artifacts on fine detail. The relationship is steepest at the high end and flattens as quality falls further.
Here is a representative spread for one 12-megapixel photo, using typical encoder behavior:
| JPEG quality setting | Approximate file size | Visible quality notes |
|---|---|---|
| 100% | 8–12 MB | Nearly indistinguishable from source; minimal savings |
| 95% | 4–6 MB | No visible loss in normal viewing |
| 85% | 2–3 MB | Excellent for print and screen; standard web choice |
| 70% | 1–1.5 MB | Fine detail softens; artifacts appear on edges |
| 50% | 500–800 KB | Blockiness visible at 100% zoom; acceptable for thumbnails |
| 30% | 200–400 KB | Obvious 8×8 block artifacts; preview use only |
Image content shifts these numbers substantially. A landscape of foliage or a crowd scene packs high-frequency detail and compresses poorly at high quality, while a studio portrait against smooth backdrop compresses far better. The table shows ranges for that reason; run a test on your own file to see where your content lands.
One underappreciated lever: chroma subsampling. Turning off 4:2:0 subsampling (using 4:4:4) roughly increases file size 20–30% but preserves saturated color edges — useful for graphics with colored text or fine patterns.
Lossy Versus Lossless: Where JPEG Fits Among Formats
JPEG's lossy approach contrasts with two format families. Lossless formats — PNG, TIFF, and the newer WebP lossless mode — preserve every pixel exactly, so repeated saving never degrades the image. Raw formats are also lossless (or near-lossless) and hold unprocessed sensor data, but they are proprietary to each camera maker and require conversion software.
The practical comparison for photos comes down to four formats:
| Format | Compression | Typical photo size (12 MP) | Best use |
|---|---|---|---|
| JPEG | Lossy | 2–4 MB at 85% | Photos for web, email, everyday sharing |
| PNG | Lossless | 15–25 MB | Screenshots, graphics, images with text |
| WebP | Both modes | 1.5–3 MB lossy | Modern web delivery with broad browser support |
| HEIC | Lossy (HEVC-based) | 1–2 MB | iPhone default; roughly half JPEG size at similar quality |
HEIC, which Apple made the iPhone default in 2017, typically produces files about 50% smaller than JPEG at comparable quality — a meaningful advantage for phone storage. Its weakness is compatibility: older Windows systems and some web tools still lack native support, which is why iPhones offer a "Most Compatible" setting that saves JPEG instead. WebP, developed by Google, offers similar savings and near-universal browser support today, but many camera workflows and print shops still expect JPEG.
For photographs, JPEG remains the most universally accepted lossy format. For line art, screenshots, or anything with sharp text, PNG wins because JPEG's block artifacts smear crisp edges badly.
The Generational Loss Problem and How to Avoid It
Each time you open a JPEG and save it again, the encoder re-compresses already-quantized data, and the rounding errors compound. Open and save a photo ten times at 85% quality and the tenth generation shows visible softening, color shifts, and block artifacts that the first save never had. Photo editors warn about this constantly, and it is the main reason archivists keep original files untouched.
The fix is workflow discipline. Edit from the original, save once to the final format, and keep the master file separate. If you must re-edit, start from the original JPEG or, better, from a raw file. Never use JPEG as an intermediate format in a multi-step editing pipeline — export to TIFF or PNG for intermediate stages, then produce the final JPEG once.
There is a subtlety with editing apps: some save JPEGs at a default quality of 90% or lower every time you tap save, silently degrading the file with each edit. Check your editor's export settings and set quality deliberately rather than accepting defaults.
Another edge case: rotating a JPEG with certain tools re-encodes it, while others apply lossless rotation using the EXIF orientation flag or lossless block transforms. The difference between a lossless rotate and a re-encode is invisible at first but accumulates over a lifetime of phone-gallery edits.
How JPEG's 8×8 Block Structure Creates Visible Artifacts
The 8×8 block grid explains JPEG's characteristic failure modes. At high compression, adjacent blocks quantize differently and their edges no longer match, producing the checkerboard "blockiness" visible in skies and smooth gradients. Sharp edges — text, wire fences, high-contrast boundaries — pick up ringing, a halo of faint ripples around the line, because the encoder zeroed the high-frequency terms needed to represent a clean transition.
Color artifacts appear as well. Because chroma is stored at half resolution, saturated reds and blues bleed across boundaries; red text on white backgrounds is a classic victim, arriving with pink fringing. This is why designers never use JPEG for logos or screenshots.
The artifacts scale with quality settings. At 85%, most viewers cannot spot them on a phone screen or a standard print. At 60%, they become noticeable on large displays. At 40%, they are obvious even at moderate zoom. Content matters: a portrait against smooth background tolerates lower quality than a detailed architectural shot.
Progressive JPEG, a variant that loads in passes from blurry to sharp, changes the loading behavior without changing the artifact structure. It is often slightly smaller than baseline JPEG at the same quality and is generally preferable for web use, though very old software may not render it.
Real File-Size Math: Storage, Bandwidth, and Backup Costs
The size difference has concrete consequences. A photographer with 10,000 photos averaging 4 MB of JPEG uses 40 GB; the same library as uncompressed 36 MB files would need 360 GB, enough to change which backup drive you buy. Cloud backup services price by storage tier, so the savings compound monthly.
Web bandwidth shows the same math. A page serving fifty 3 MB JPEGs moves 150 MB per visitor; converting those to 1.5 MB WebP files halves it to 75 MB. On a site with 100,000 monthly visitors, that difference is 7.5 terabytes of transfer per month — enough to affect hosting plan choice and load times that search engines measure.
Email and messaging limits make JPEG practically mandatory. Most email services cap attachments around 25 MB, so a single uncompressed photo can exceed the limit or fill it entirely, while a 3 MB JPEG leaves room for a dozen more. Messaging apps recompress images anyway, so sending a low-quality original gains nothing.
Storage on phones tells the same story from the other direction. A 128 GB iPhone fills with roughly 32,000 HEIC photos or 16,000 JPEGs at typical sizes — which is precisely why Apple moved to HEIC and why Android phones lean on similar efficient codecs.
When JPEG Is the Wrong Choice
JPEG fails specific jobs, and knowing them prevents damage. Images with text, line art, logos, or screenshots suffer visible smearing because sharp edges are exactly what quantization destroys; PNG or SVG serves those cases. Images needing transparency cannot use standard JPEG at all, since the format has no alpha channel. Images requiring repeated editing should stay in raw or TIFF until the final export.
Medical imaging, forensic photography, and archival digitization often prohibit lossy compression entirely because diagnostic or legal detail must survive bit-for-bit. Astronomy and scientific imaging similarly demand lossless formats; a faint nebula detail that quantization rounds away cannot be recovered.
Very large prints expose JPEG limits too. A heavily compressed file that looks fine on a phone can show blockiness across a 24×36-inch print viewed closely, because the artifacts scale up with the print. Photographers printing large typically capture raw and export a maximum-quality JPEG or TIFF for the printer.
The rule of thumb: JPEG for photographs destined for screens, email, and standard prints; another format whenever text, transparency, repeated editing, or exact fidelity matters.
FAQ
Does saving a JPEG at 100% quality keep it lossless?
No. Even at 100%, JPEG still applies the DCT transform and quantization — the tables are just set very fine, so losses are tiny rather than zero. A 100% JPEG can still differ from the source pixel by pixel, and re-saving it degrades it further. Only PNG, TIFF, or raw formats preserve exact pixel values.
Why did my photo get smaller when I emailed it?
Most email clients and messaging apps automatically recompress attached images, often downscaling resolution and dropping quality to around 70–80%. The received file is a new, smaller JPEG generated from yours, not the original. Send photos as links to cloud storage or zip them if exact quality matters.
Is HEIC better than JPEG for phone photos?
HEIC typically produces files around half the size of a comparable-quality JPEG, according to Apple's own documentation, which is why iPhones default to it. The catch is compatibility: older Windows versions, some web upload forms, and certain printers reject HEIC. Switch to "Most Compatible" in iPhone camera settings if you regularly share to such systems.
Can I recover quality after compressing a JPEG too far?
No. Quantization permanently discards the frequency data, and no tool can reconstruct detail that was rounded to zero. AI upscalers can produce plausible-looking sharpness, but it is invented detail, not recovered data. Always keep the original file if there is any chance you will need higher quality later.
How many times can I edit and save a JPEG before it looks bad?
Visible degradation typically appears after three to five save cycles at 85% quality, sooner at lower settings and with detailed subjects. The safe practice is one save from the original per final output. If you expect multiple editing rounds, work in TIFF or PNG and export JPEG once at the end.
Does JPEG compression affect print quality?
It can, depending on print size and viewing distance. At 85% quality, a 12-megapixel JPEG prints cleanly up to roughly 8×10 inches; larger prints or close viewing reveal block artifacts. For prints beyond about 16×20 inches, capture raw and export at maximum quality or use TIFF.
Why do JPEG files sometimes look blocky in smooth skies?
Smooth gradients are where the 8×8 block boundaries become most visible, because adjacent blocks quantize slightly differently and the mismatches show as faint squares. Sky, fog, and studio backdrops expose this first. Raising quality above 90% or switching to a lossless format for such images eliminates it.