Files & Storage

Lossless vs lossy compression

Also known as: lossy vs lossless

Compression makes files smaller, and it comes in two kinds.

Lossless compression, used in ZIP files, PNG images, and FLAC audio, shrinks data so it can be restored exactly, bit for bit. Lossy compression, used in JPEG photos, MP3 and AAC music, and streaming video, achieves much smaller files by permanently discarding details people are unlikely to notice. While lossy formats make streaming and phone storage practical, repeatedly editing and re-saving lossy files gradually degrades quality.

Lossless vs lossy compression, explained at three levels

At home

Lossless compression is like folding a shirt neatly to fit in a suitcase: it takes less space, and when you unfold it, it's exactly the same. Lossy compression is like trimming the sleeves to fit even more: the suitcase closes easily, but the cut fabric is gone for good. Files work the same way, with lossless shrinking without loss and lossy throwing away detail.

At work

Compression makes files smaller so they take less storage and travel faster. Lossless compression, used in ZIP files and PNG images, can be reversed exactly, bit for bit. Lossy compression, used in JPEG photos, MP3 audio and streaming video, permanently discards detail people barely notice to get much smaller files. Businesses care because using lossy formats for originals can lose quality forever.

Real-world examples

At home

Thomas edited the same JPEG photo and saved it many times. It became blotchy, so he started editing a lossless copy and exporting a JPEG only at the end.

At work

Aisha manages media for a Vancouver marketing firm. Master videos are stored losslessly, while compressed versions are made for social media and the website.

How it compares

featureLosslessLossy
Data keptAll of itSome is discarded
File sizeLargerMuch smaller
ExamplesZIP, PNG, FLACJPEG, MP3, MP4 video
Best forOriginals, documents, archivesSharing, streaming

Lossless keeps everything. Lossy trades detail for size.

For analysts

In digital asset or records projects, I'd specify which formats are 'masters' and which are 'distribution copies.' It avoids losing quality that can never be recovered.

History & origin

Claude Shannon's information theory in 1948 laid the mathematical foundations for compression. David Huffman's coding method in 1952 and the Lempel-Ziv algorithms of 1977 and 1978 underpin most lossless formats, and Phil Katz released the ZIP format in 1989. On the lossy side, the JPEG image standard arrived in 1992, and the MP3 format, developed largely at Germany's Fraunhofer Institute, was standardized in the early 1990s and transformed music sharing. PNG appeared in 1996 as a patent-free lossless image format, and FLAC in 2001 for lossless audio. Streaming services later offered lossless audio tiers. In my view, knowing which kind you're using prevents a lot of accidental quality loss.