Lossless vs Lossy Compression: What Every File Converter Should Know

Understand the real difference between lossless and lossy compression, how each works under the hood, and when to use which. Covers images, audio, and video with practical conversion advice.

Published February 10, 2026 · Updated February 10, 2026

Every time you convert a file, save a photo, or export a video, you're making a choice about compression — whether you realize it or not. That choice boils down to a single question: do you want to keep every single bit of original data, or are you willing to throw some of it away in exchange for a dramatically smaller file?

That's the fundamental divide between lossless and lossy compression, and it's the most important concept in all of digital media. Get it wrong and you'll either waste storage on unnecessarily bloated files, or you'll destroy quality in ways that can't be undone. Get it right and you'll have files that look, sound, and play exactly as good as they need to be — at a fraction of the size.

This guide is going to explain both types of compression from the ground up: how they actually work, where each one excels, and how to make the right choice for every situation you'll encounter when converting files.

Information vs Perception: What Compression Actually Does

Before we get into algorithms and format names, it helps to understand why compression works at all. The short answer: digital files contain a staggering amount of redundancy, and human senses have hard limits.

Consider a photograph of a blue sky. The image might be 4000 x 3000 pixels — 12 million pixels total. But how many unique colors does that sky actually contain? Thousands, maybe. Not millions. Huge regions of the image are nearly identical shades of blue. Storing each pixel independently, as if every one were unique, is wasteful. Compression identifies and eliminates that redundancy.

Now here's where lossless and lossy diverge:

  • Lossless compression eliminates only mathematical redundancy. It finds smarter ways to describe the same data. The sky is still stored with every exact shade intact — the encoder just uses fewer bytes to say "these 500 pixels are all this shade of blue" instead of listing each one individually.

  • Lossy compression goes further. It eliminates perceptual redundancy — data that's mathematically present but that human eyes (or ears) can't actually detect. That sky has subtle color variations between adjacent pixels that no human can distinguish at normal viewing distance. A lossy encoder rounds those nearly-identical shades to the same value, creating opportunities for even more aggressive compression.

The result? Lossless compression typically reduces file sizes by 2:1 to 4:1. Lossy compression routinely achieves 10:1 to 50:1 ratios — sometimes more — at quality levels where most humans can't spot the difference.

That "most humans can't spot the difference" qualifier is doing a lot of heavy lifting. It's the key to understanding when lossy is perfectly fine and when it's absolutely not.

How Lossless Compression Works

Lossless compression is, in a sense, the "honest" approach to file size reduction. It's data compression in its purest form: make the file smaller, but guarantee that every single bit can be perfectly reconstructed. Not approximately. Not "close enough." Bit-for-bit identical.

Here's how the main techniques work.

Run-Length Encoding (RLE)

The simplest form of lossless compression. If a file contains a sequence like "AAAAAABBBCC," RLE replaces it with "6A3B2C." Same data, fewer characters.

RLE is surprisingly effective for certain types of content. A screenshot of a text editor has massive runs of identical background-color pixels. A simple logo on a white background is mostly white. RLE can compress these dramatically. But for photographs with continuous tonal variation, where no two adjacent pixels are likely to be identical, RLE does almost nothing.

Huffman Coding

A more sophisticated approach. Huffman coding analyzes the frequency of each value in the data and assigns shorter codes to common values and longer codes to rare ones.

Think of Morse code — the letter E (the most common in English) is represented by a single dot, while Q (much rarer) needs a dash-dash-dot-dash. Huffman coding applies the same principle to any data stream. In a photograph, if the value 128 appears 50,000 times and the value 3 appears 12 times, the encoder represents 128 with a few bits and 3 with many more.

The result: a file where the most frequently occurring data takes up the least space. Combined with RLE, this can achieve solid compression ratios without losing a single data point.

LZ77 and Deflate

The real workhorse behind formats like PNG and ZIP. LZ77 (created by Abraham Lempel and Jacob Ziv in 1977) works by finding repeated patterns in the data and replacing subsequent occurrences with references to earlier ones: "go back 847 bytes and copy 23 bytes from there."

Deflate combines LZ77 with Huffman coding and is the algorithm behind:

  • ZIP archives — the most intuitive analogy. When you ZIP a Word document, the file gets smaller, but when you unzip it, every word, every formatting mark, every embedded image is perfectly preserved. That's lossless compression in action.
  • PNG images — each row of pixels is filtered to maximize redundancy, then Deflate-compressed.
  • FLAC audio — uses linear prediction followed by entropy coding (similar in spirit to Huffman/Deflate).
  • gzip — the backbone of web compression, making web pages load faster without altering a single character of HTML.

The key guarantee: decompress the output, and you get back the exact original input. Not "visually similar." Not "good enough." Identical. You can verify this with a checksum — the hash of the original file and the decompressed file will match perfectly.

The Limitation

Lossless compression can only achieve modest ratios because it's constrained by the actual information content of the data. Information theory puts hard limits on how much a lossless encoder can compress any given data set. For photographic images, that limit is typically 2:1 to 3:1. For audio, similar. For already-compressed data, lossless compression often achieves almost nothing — which is why zipping a folder of JPEGs barely reduces the total size.

How Lossy Compression Works

Lossy compression breaks the constraint that lossless obeys. It accepts that the output won't be bit-for-bit identical to the input, and in exchange, it achieves dramatically higher compression ratios. The trick is being smart about what to throw away — discarding the data that humans are least likely to notice.

Discrete Cosine Transform (DCT)

The mathematical core of JPEG, MP3, and most video codecs. DCT converts data from the "spatial" domain (individual pixel or sample values) into the "frequency" domain (patterns of variation).

For images, the process works like this: the encoder breaks the image into small blocks (8x8 pixels for JPEG) and applies DCT to each block. The result is a set of frequency coefficients — low frequencies represent the broad shapes and colors in the block, high frequencies represent fine detail, sharp edges, and noise.

Here's the insight that makes lossy compression work: the human visual system is far more sensitive to low-frequency information (gradual gradients, large shapes) than to high-frequency information (tiny texture details, subtle noise). You'll immediately notice if someone shifts the color of a blue sky from azure to teal. You won't notice if they smooth out the microscopic grain pattern in that same sky.

Quantization: Where the Magic (and the Loss) Happens

After DCT, the encoder has a set of frequency coefficients for each block. Quantization is the step that actually discards data. Each coefficient is divided by a number from a "quantization table" and rounded to the nearest integer.

Low-frequency coefficients are divided by small numbers — preserving them with high precision. High-frequency coefficients are divided by large numbers — rounding them aggressively, often to zero. Once a coefficient hits zero, that detail is gone. Not blurred, not hidden — deleted.

The quality slider you see when saving a JPEG or exporting audio? It controls the quantization table. Quality 95 uses gentle quantization that preserves most high-frequency detail. Quality 20 uses aggressive quantization that zeros out nearly everything except the broad shapes. Same algorithm, dramatically different results.

Perceptual Models: Psychoacoustics and Psychovisual Science

The best lossy encoders don't just do math — they model human perception.

MP3 encoding uses a psychoacoustic model that knows, for example, that a loud sound at 1kHz will "mask" a quiet sound at 1.1kHz — your ear physically cannot hear the quieter sound because the louder one overwhelms the same region of the basilar membrane. The encoder safely discards the masked sound because no human ear could detect its absence.

JPEG and modern image codecs use psychovisual models that know humans are more sensitive to changes in brightness than in color (which is why JPEG compresses the chrominance channels more aggressively than the luminance channel), and that we're less sensitive to detail in areas that are already noisy or highly textured.

These perceptual models are the reason lossy compression can achieve 20:1 or 50:1 ratios while still looking and sounding good to most people. The encoder isn't just deleting data randomly — it's selectively removing the data that your biology can't detect.

Compression Across Media Types

The lossless vs lossy distinction plays out differently for images, audio, and video. Each medium has its own set of formats, trade-offs, and practical considerations.

Images

Images are where most people first encounter the compression question, usually when deciding between PNG and JPEG.

Format Compression Type Typical Ratio Transparency Best For
PNG Lossless 2:1 – 4:1 Yes (alpha) Screenshots, logos, text, graphics, anything with sharp edges
JPEG Lossy 10:1 – 30:1 No Photographs, natural scenes, smooth gradients
WebP Both (lossless and lossy modes) Lossy: 25-35% smaller than JPEG; Lossless: 25% smaller than PNG Yes (alpha) General-purpose web images — the best all-rounder in 2026
AVIF Both (lossless and lossy modes) 30-50% smaller than JPEG Yes (alpha) Maximum compression when broad compatibility isn't critical
TIFF Lossless (typically uncompressed or LZW) 1:1 – 3:1 Yes Professional photography, print, archival
GIF Lossless (but limited to 256 colors) Varies widely Yes (1-bit) Simple animations, very simple graphics

The key insight for images: PNG and JPEG aren't competing — they're designed for completely different content types. PNG excels at synthetic images (screenshots, diagrams, text, logos) where sharp edges and flat colors create lots of redundancy for lossless compression to exploit. JPEG excels at photographic images where continuous tonal variation makes lossless compression inefficient but perceptual masking makes lossy compression effective.

WebP and AVIF blur this line because they offer both modes. A lossless WebP is typically 25% smaller than an equivalent PNG. A lossy WebP at the same perceptual quality is 25-35% smaller than JPEG. This is why WebP has become the default recommendation for web images.

Practical numbers: A 12-megapixel photograph (4000x3000 pixels) in different formats:

  • Uncompressed BMP: ~36 MB
  • PNG (lossless): ~15-20 MB
  • JPEG quality 90: ~3-4 MB
  • WebP quality 80: ~2-3 MB
  • AVIF quality 60: ~1.5-2 MB

The difference between PNG and JPEG for the same photograph is staggering — 5x to 7x — and that's the whole point. For a photo, the perceptual difference between the PNG and the high-quality JPEG is invisible to normal viewing, but the file size difference is enormous.

Audio

Audio compression follows the same lossless vs lossy divide, but the perceptual models are different because we're dealing with hearing instead of vision.

Format Compression Type Typical Bitrate File Size (5-min song) Best For
WAV Uncompressed (PCM) 1,411 kbps (CD quality) ~50 MB Professional editing, mastering, archival
FLAC Lossless ~900 kbps (varies) ~30 MB Archival, audiophile listening, source material
ALAC Lossless ~900 kbps (varies) ~30 MB Apple ecosystem archival
MP3 Lossy 128-320 kbps 5-10 MB Universal playback, sharing
AAC Lossy 96-256 kbps 3-8 MB Streaming, Apple ecosystem, better than MP3 at same bitrate
OGG Vorbis Lossy 96-320 kbps 4-10 MB Open-source projects, games, web audio

The key insight for audio: Lossless audio (FLAC, WAV) is about 3-5x larger than high-quality lossy audio (MP3 320kbps, AAC 256kbps). In controlled double-blind listening tests, most people — including trained audio engineers — cannot reliably distinguish FLAC from a high-bitrate lossy encode using consumer audio equipment.

That doesn't mean lossless audio is pointless. It means lossless audio is for specific purposes: archiving your music library so you can re-encode to any lossy format later without generation loss, professional production where every editing step introduces rounding, and situations where storage is cheap and bandwidth isn't a constraint.

For casual listening, streaming, and sharing, lossy at 192kbps AAC or 256kbps MP3 is more than sufficient. Below 128kbps, artifacts become audible to most listeners — cymbals get "swishy," vocals lose presence, and the stereo image narrows.

Video

Video is the outlier. Almost all video you encounter is lossy-compressed, and for good reason: the numbers make lossless video impractical for nearly every use case.

Codec Compression Type Compression Ratio (vs raw) Typical Use
H.264 (AVC) Lossy ~50:1 to ~200:1 Universal playback, web video, most consumer cameras
H.265 (HEVC) Lossy ~100:1 to ~400:1 4K content, newer devices, iPhone recordings
VP9 Lossy ~100:1 to ~400:1 YouTube, web streaming, royalty-free alternative to HEVC
AV1 Lossy ~120:1 to ~500:1 Next-gen streaming (Netflix, YouTube), best compression
FFV1 Lossless ~2:1 to ~3:1 Archival, film preservation
ProRes Visually lossless (technically lossy but at negligible quality loss) ~3:1 to ~5:1 Professional editing, post-production

The key insight for video: One minute of uncompressed 4K video at 30fps is about 18 GB. Lossless compression gets that to maybe 6-9 GB. H.265 lossy compression gets it to around 30-60 MB at broadcast quality. The difference between lossless and lossy for video is 100x or more.

This is why lossless video exists almost exclusively in professional archival and post-production workflows. For delivery — streaming, web embedding, sharing, storage — lossy video is the only viable option. The entire streaming industry is built on the assumption that lossy video compression works well enough for human viewers.

Generation Loss: The Silent Quality Killer

Here's the single most important practical consequence of the lossless vs lossy distinction: generation loss.

Every time you open a lossy file, edit it (or even just re-save it), and export it to the same lossy format, you lose more quality. The encoder runs quantization again, zeroing out more coefficients, introducing more rounding errors, compounding the damage from the previous encode.

This is cumulative and irreversible. Save a JPEG, reopen it and save it again 10 times, and you'll see visible degradation — increased blockiness, loss of detail, color shifts. Do the same thing 50 times and the image becomes an unrecognizable mess of artifacts. The internet meme of "needs more JPEG" is literally what happens when an image gets re-encoded through lossy compression over and over as it's shared across platforms.

Generation loss in practice:

  • Social media re-sharing — every time someone screenshots a meme and re-uploads it, the platform re-compresses it. After a few rounds, text becomes blurry, faces lose detail, and colors get muddy. This is why images that go viral often look terrible.
  • Video editing — editing a compressed MP4, exporting to MP4, then importing that into another editor and exporting again compounds artifacts. Professional editors avoid this by working in lossless or "visually lossless" intermediate codecs (ProRes, DNxHR) during editing.
  • Audio production — bouncing an MP3 to a new MP3 introduces additional psychoacoustic artifacts with each generation. Producers keep masters in WAV or FLAC and only export to MP3 at the final delivery stage.

The rule: Never use a lossy file as a source for further editing if you have access to the original. Always go back to the lossless master, make your changes, and export to lossy once, at the end of the pipeline.

Lossless formats don't have this problem. You can decompress and re-compress a PNG, FLAC, or ZIP file a million times and the output will be identical to the original every single time. There's nothing to degrade because nothing was discarded.

Choosing the Right Compression: A Decision Framework

The "right" compression depends entirely on what you're doing with the file. Here's a practical framework.

Use Lossless When:

  • Archiving originals — if you're storing files for long-term preservation (family photos, music collection, project masters), always keep a lossless version. Storage is cheap; lost quality is permanent.
  • Working files for editing — if you're going to open this file in an editor, make changes, and re-save it, lossless prevents generation loss. Edit in PNG or TIFF, deliver in JPEG.
  • Text, screenshots, or graphics — content with sharp edges, flat colors, and fine text detail. Lossy compression smudges text and creates artifacts around sharp edges. PNG handles this content beautifully.
  • Source material for multiple outputs — if you need to generate several versions of a file (thumbnails, social media sizes, web and print), keep the master lossless and generate lossy outputs from it.
  • Legal or medical documents — any context where altered data could have consequences. A medical scan or a legal document scan should be stored losslessly.

Use Lossy When:

  • Web delivery — website images, embedded videos, podcast episodes. Every kilobyte matters for load time and bandwidth costs. Lossy at the right quality setting is visually indistinguishable and dramatically smaller.
  • Sharing via email or messaging — file size limits make lossy essential. An 18 MB PNG becomes a 2 MB JPEG that looks identical in the body of an email.
  • Social media — platforms re-compress everything you upload anyway. There's no point uploading a 20 MB PNG to Instagram; it'll be re-encoded to a ~500 KB JPEG. Upload a well-compressed JPEG or WebP and at least control the quality yourself.
  • Streaming and playback — audio and video for consumption. Nobody is streaming FLAC over cellular data or raw video to a TV.
  • Storage-constrained devices — phones, tablets, cheap laptops with limited storage. A music library in FLAC at 30 MB per track vs MP3 at 7 MB per track is the difference between 3,000 and 14,000 songs in 100 GB.

The Hybrid Approach (Usually Best)

The smartest strategy is both: keep lossless masters, distribute lossy copies.

Shoot photos in RAW. Archive as TIFF or PNG. Export to WebP or JPEG for your website. Record audio in WAV. Keep masters in FLAC. Distribute as MP3 or AAC. Record video in the highest quality your camera supports. Edit in a lossless-friendly codec. Export to H.264 or H.265 for delivery.

This gives you the best of both worlds: a perfect-quality master that can be re-used forever, and optimally-sized delivery files that load fast and use minimal bandwidth.

Practical Recommendations with Fileza

When you're converting files with Fileza, every conversion happens right in your browser — no uploads, no servers, no privacy concerns. Here's how to apply the lossless vs lossy decision to the most common conversions.

Image Conversions

PNG to JPEG — You're going from lossless to lossy. This makes sense when you need smaller files for web use, email, or social media. Use quality 85-92 for an excellent balance of size and quality. Keep your original PNG.

JPEG to PNG — You're going from lossy to lossless. This preserves the current quality without further degradation, but it won't restore quality lost in the original JPEG encoding. The PNG will actually be larger than the JPEG because lossless encoding of photographic content is less efficient than lossy. Do this when you need transparency support or want to prevent further generation loss during editing.

Anything to WebP — WebP is an excellent destination format for web images. It supports both lossless and lossy modes. Lossy WebP at quality 80 typically produces files 25-35% smaller than equivalent-quality JPEG. Lossless WebP is roughly 25% smaller than PNG.

PNG to WebP (lossless) — Smaller file, same perfect quality. A straightforward win. Great for websites where you need transparency and pixel-perfect graphics.

Audio Conversions

WAV to MP3 — The classic conversion. You're going from uncompressed to lossy. Use 256kbps or 320kbps for high-quality results that are indistinguishable from the original for nearly all listeners. Use 192kbps for a good quality-to-size ratio. Keep the original WAV.

WAV to FLAC — Going from uncompressed to lossless compressed. The FLAC will be roughly 30-40% smaller than the WAV with zero quality loss. This is a no-downside conversion — you should almost always store uncompressed audio as FLAC instead of WAV unless you need WAV for specific software compatibility.

MP3 to WAV or FLAC — This converts lossy to lossless, but it cannot restore lost quality. The output will sound identical to the MP3 input (not better), but the file will be much larger. Only do this if you need WAV/FLAC format for compatibility with specific software or hardware.

Video Conversions

Any video to MP4 (H.264) — The safest choice for compatibility. H.264 in an MP4 container plays on virtually every device made in the last 15 years. Use this when you're unsure about the recipient's setup.

Reducing video file size — If your video is too large, converting to MP4 with reasonable compression settings can dramatically reduce size. A 500 MB screen recording might drop to 50-80 MB with no visible quality loss because screen content (flat colors, static UI elements) compresses extremely well.

The Golden Rules for Conversion

  1. Never convert lossy to lossy unnecessarily. Converting MP3 to AAC or JPEG to WebP (lossy) re-encodes the data, introducing a new round of quality loss. If you must do this, use the highest quality setting practical.

  2. Keep your originals. Before converting, make sure you have the original file saved somewhere. Fileza processes everything in your browser without uploading, but the conversion itself is a one-way operation for lossy formats.

  3. Match the format to the purpose. Don't use PNG for photographs you're putting on a website. Don't use JPEG for screenshots of text. Choose the format that matches your content type and delivery requirements.

  4. When in doubt, use WebP. For images, WebP gives you the best balance of quality, size, and compatibility in 2026. It supports both lossless and lossy modes, handles transparency, and works in every modern browser.

Conclusion

Lossless and lossy compression aren't competing philosophies — they're complementary tools designed for different stages of the same workflow. Lossless is for preservation: keeping your originals intact, maintaining editing flexibility, and ensuring nothing is permanently lost. Lossy is for delivery: making files small enough to share, stream, and display efficiently by removing data that humans cannot perceive.

The technical details — DCT transforms, quantization matrices, Huffman trees, psychoacoustic masking — are fascinating, but the practical takeaway is simpler. Ask yourself two questions: Will I need to edit this file again? And does every byte of quality matter for this use case?

If the answer to either is yes, use lossless. If you're distributing to end users and file size matters, use lossy at a quality setting where the compression artifacts are invisible. And when possible, do both — archive lossless, deliver lossy.

Every conversion you run in Fileza happens entirely in your browser. Your files never leave your device, so you can experiment freely. Try converting the same image to PNG and to JPEG at various quality levels. Compare the file sizes. Zoom in and look for artifacts. Once you see the trade-off firsthand, the choice between lossless and lossy will feel obvious every time.