How Compression Works
Lossless and lossy methods, redundancy, codecs and ratios.
Compression starts from one observation: many files hold more bytes than they need. A report repeats words, a photo has long stretches of similar color, and a log file repeats nearly identical lines. A compressor finds that repetition and writes the same information in fewer bytes. A decompressor reverses the process.
The guides in this topic start with the plain definition and then open the machinery. They cover lossless methods that give back every original byte, lossy methods that discard detail you are unlikely to miss, the ideas behind Huffman coding and DEFLATE, and the reason some files barely shrink at all. You will also learn how to read a compression ratio and what a codec is.
One article clears up a naming clash. The word compressor also names an audio tool that evens out loudness. This site is about data compression, and that article explains the difference. Each guide links to the compression ratio calculator, so you can try the arithmetic on your own sizes.
All 9 articles in this topic
How Compression Works
What Is Data Compression? A Plain-English Guide
How files shrink without losing their meaning, why some cannot, and how to measure the savings.
How Compression Works
Lossless vs. Lossy Compression: What You Keep and What You Lose
Where lossless and lossy compression differ, with a worked size example and rules for choosing.
How Compression Works
How Repeated Patterns Let Files Shrink
Runs, repeated strings and near-equal neighbors are what compressors look for, shown with hand-checkable examples.
How Compression Works
Huffman Coding Explained with a Worked Example
A 14-character example shows how Huffman coding assigns short codes to common symbols, with every bit counted.
How Compression Works
How DEFLATE Works: The Method Behind ZIP, gzip and PNG
DEFLATE in plain words: pointers to earlier data, Huffman codes, and the wrappers that make ZIP, gzip and PNG.
How Compression Works
Compression Ratio Explained: How to Calculate and Read It
Ratio, percent saved and space saved from the same two sizes, with a conversion table and common traps.
How Compression Works
Why Some Files Barely Shrink When You Compress Them
Why photos, music and archives resist compression, and the counting argument that proves no method wins every time.
How Compression Works
What Is a Codec? Encoding and Decoding Explained
What a codec is, why raw audio and video are too big without one, and how a codec differs from a file type.
How Compression Works
Data Compression vs. Audio Compressors: Two Meanings of "Compressor"
Why "compressor" names two unrelated things, with the controls of the audio kind explained and sized by example.