Lossless compression reduces file size in a way that can be fully reversed, so the original data returns bit for bit. Lossy compression removes information judged less important, giving smaller files that cannot be restored exactly.
Why it matters
The choice balances size against fidelity. Text, code, and archives need lossless compression, since one wrong byte can corrupt them. Photos, music, and video usually use lossy compression because small losses are hard to notice and savings are large.
Quality loss builds up each time a lossy file is edited and saved again.
Example
Lossless: ZIP, PNG, FLAC, gzip
Lossy: JPEG, MP3, AAC, H.264, lossy WebP
Saving a photo as PNG keeps every pixel. Saving it as JPEG at quality 80 gives a smaller file whose pixels differ slightly from the original.
Common misconceptions
- Converting a lossy file to a lossless format and expecting the quality back.
- Compressing source masters with lossy formats.
- Using lossy compression for text, spreadsheets, or code.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.