Optimization

The Complete Guide to File Compression

Compression is how the digital world fits — photos in your storage, videos over your connection, documents in an inbox. This guide explains how it actually works and how to choose the right approach for any file type.

The one idea behind everything: lossless vs lossy

  • Lossless compression rearranges data more efficiently without discarding any of it. Decompress and you get back the exact original, bit for bit. Used by ZIP, PNG and FLAC. Savings are modest but perfectly safe.
  • Lossy compression permanently discards information — ideally only what your senses can't detect. Used by JPG, WebP, MP3 and H.264. Savings are dramatic, and the art is losing only what won't be missed.
The whole skill of compression is knowing which kind a file needs — and, for lossy, where the “can't tell the difference” line sits.

Images

Photos are lossy territory (JPG, WebP, AVIF); graphics and anything needing transparency are lossless territory (PNG, lossless WebP). Getting the format right matters more than any slider. Start with PNG vs JPG vs WebP and compressing without losing quality.

PDFs

A PDF is a container. Its text is tiny vector data; its images are the weight. Compressing a PDF means downsampling and recompressing those images while leaving text sharp and selectable. See compressing a PDF without losing quality.

Video

Video is the heaviest media and the most compressible, thanks to codecs that exploit similarity between frames. The levers are codec, quality (CRF) and resolution — details in compressing videos without losing quality.

Audio

Lossy audio (MP3, AAC, Opus) discards frequencies masked by louder sounds, cutting size by ~90% versus raw WAV with little audible difference at sensible bitrates. Lossless audio (FLAC) shrinks ~40–50% while staying bit-perfect — for archiving.

Archives (ZIP)

ZIP is general-purpose lossless compression, ideal for bundling and shrinking text, code and documents. It barely helps on already-compressed media (JPG, MP4, MP3) — those are already dense.

Where files should be compressed

Whenever a job can run locally in your browser, that's the best place — private, instant and unlimited. Heavier jobs sometimes need server or desktop horsepower. We break this down in browser vs cloud compression.

Start here

The most common compression task — images — is free, unlimited and private with the FreeCompressor image tool, and PDF, video and audio tools are on the way. For quick wins across every file type, see our 15 file compression tips.