Skip to content

Glossary

Lossless compression

Compression that preserves every byte

Lossless compression reduces file size while preserving every byte of the original. Decompressing produces output bit-identical to the input. Tradeoff: smaller savings than lossy compression — typically 30-70% size reduction depending on content.

How it works: lossless algorithms find statistical patterns (repeated substrings, predictable sequences) and encode them with shorter representations. Two classic families:

  • Dictionary-based (LZ77, LZ78, LZW): build a dictionary of seen substrings and emit back-references. The basis of DEFLATE, gzip, ZIP.
  • Entropy coding (Huffman, arithmetic coding, ANS): assign shorter binary codes to more frequent symbols. Typically combined with dictionary methods.

Common lossless formats:

  • PNG — images (uses DEFLATE)
  • FLAC — audio (preserves 16-24 bit PCM, typically 50-60% the size of WAV)
  • ZIP, gzip, Brotli, Zstandard — general data
  • WebP and AVIF — both support lossless modes
  • Git pack files — source-code repository storage

Use lossless when you need bit-perfect reproduction, when the content will be edited further, or when the file is text/structured data (which doesn’t compress well lossily anyway).

Related

Published May 15, 2026