Lossless compression: smaller, but nothing is lost
Lossless compression finds patterns and repetition in data and writes them down more efficiently. If a row of an image is 500 identical white pixels, a lossless format can store "500 × white" instead of repeating the same value 500 times. When the file is opened, the original is rebuilt exactly, bit for bit.
That makes lossless compression the only option for anything where a single changed byte matters: text, spreadsheets, program files, databases and archives. Common lossless formats include ZIP, 7z, gzip, PNG, FLAC audio and lossless WebP.
The trade-off is size. Lossless compression can only remove redundancy, so how much it saves depends entirely on the content: a plain text file may shrink by 60–80%, while a photo that is already compressed barely shrinks at all.
Lossy compression: much smaller by discarding detail
Lossy compression goes further. Instead of only removing repetition, it removes information — the kind human eyes and ears are least sensitive to. A JPEG encoder, for example, keeps brightness detail but simplifies fine colour variation and smooths textures in small blocks. MP3 and AAC audio drop sounds that are masked by louder ones.
The result can be 5 to 20 times smaller than the original while looking or sounding almost the same. The catch is that the discarded data is gone for good: you can't decompress a JPEG back into the original photo. Common lossy formats include JPEG, lossy WebP, AVIF, MP3, AAC and almost every video format (H.264, H.265, AV1).
Side by side
Lossless — exact copy after decompression · moderate savings (often 10–60%) · best for text, documents, code, archives, screenshots and logos · formats: ZIP, 7z, PNG, FLAC, lossless WebP.
Lossy — an approximation of the original · large savings (often 70–95%) · best for photos, audio and video · formats: JPEG, lossy WebP, AVIF, MP3, AAC, MP4.
A useful rule: if the file will be read by a computer (a contract, a spreadsheet, source code), use lossless. If it will be seen or heard by a person (a photo, a podcast, a video), lossy is usually the better choice.
Does compressing a file reduce quality?
Only with lossy compression. A lossless ZIP or PNG never changes the content. A lossy JPEG or WebP does — but at sensible settings the change is invisible. For photos, a quality of 75–85% typically looks identical to the original on screen while being a fraction of the size.
Quality loss becomes visible when you push the setting too low (blocky artefacts, smeared detail, banding in skies) or when you re-compress a file that was already compressed. Each lossy save throws away a little more, so always start from the best original you have rather than editing and re-saving the same JPEG over and over.
Which one should you use?
Photos: lossy. Save as JPEG or WebP at 75–85% quality. Use the JPEG compressor or convert to WebP with JPG to WebP.
Screenshots, logos, diagrams, text in images: keep PNG. These have sharp edges and few colours, where lossy formats create visible fuzz. Shrink them with Compress PNG, which reduces the colour palette — technically a mild lossy step, but invisible on flat graphics.
PDFs: a mix. Text and vector graphics stay lossless; embedded photos are recompressed. MiniFiles' PDF compressor resamples images inside the PDF while text stays perfectly sharp.
Documents, spreadsheets, code and anything you must restore exactly: lossless only. Zip them with your operating system's built-in tool.
Animated GIFs: GIF itself is lossless, but compressing a GIF usually means a lossy reduction of colours and pixel detail to get a usable size.
Is PNG lossless? Is WebP lossless?
PNG is a lossless format: saving an image as PNG never changes its pixels. Many PNG compressors, including MiniFiles, make PNGs smaller by first reducing the number of colours (colour quantisation) — that step is lossy, even though the file is still a PNG.
WebP supports both modes. Lossless WebP is typically 25% smaller than PNG; lossy WebP is usually 25–35% smaller than JPEG at similar quality. MiniFiles produces lossy WebP at the quality you choose.
JPEG is always lossy, even at 100% quality. GIF is lossless but limited to 256 colours per frame.
How MiniFiles compresses your files
MiniFiles runs every compression in your browser, so your files never leave your device. Each format uses the method that suits it: lossy re-encoding for JPEG and WebP, colour-palette reduction for PNG, gifsicle for animated GIFs, and Ghostscript for PDFs, which resamples images while keeping text and vectors lossless. You can see the original and compressed size before downloading, and compare the two side by side.
Want to know more about what happens inside a compressed file? Read how file compression works.