X

What Is a Codec? The Plain-English Guide

A codec is the thing that shrinks video and audio down to a size your internet connection can carry, then unpacks it again on the way out - here is what that means in practice.

A large uncompressed video file passing through a codec and emerging as a small compressed file

Almost every video and every song you have ever played arrived compressed.

A codec is the set of rules used to compress it on the way in and expand it on the way out.

That is the whole idea, and everything below is detail.

In one line. A codec squeezes audio or video into a manageable size, and your player needs the matching codec to unsqueeze it again.

Why Anything Needs Compressing at All

Raw video is enormous. One second of uncompressed 1080p at thirty frames a second comes to about 186 MB, which works out at roughly eleven gigabytes a minute.

A two-hour film at that rate would be around 1.3 terabytes, and no phone, disc or broadband connection is going to carry that.

Compressed with a modern codec, that same film fits comfortably in a few gigabytes and streams over an ordinary connection. The codec is what closes that gap.

Encoder, Decoder, Codec - Three Words for Two Jobs

Diagram showing an encoder compressing a file for storage and a decoder expanding it again for playback

The word codec is a mash-up of coder and decoder. It covers both halves of the job.

The encoder is what a camera, a phone or a conversion tool uses to make the file smaller in the first place. The decoder is what your player uses to turn it back into pictures and sound.

Most people only ever need the decoder half. If you are just watching and listening, "installing a codec" almost always means installing a decoder.

Why the distinction matters. A device can often play a format it cannot create. Plenty of phones decode AV1 perfectly but have no way to record in it.

Lossy or Lossless - The Only Choice That Really Matters

Every codec is one or the other, and the difference is simple.

Lossy codecs throw data away permanently, betting that you will not notice what went missing. Lossless codecs pack the data more cleverly without discarding any of it, so what comes out is bit-for-bit identical to what went in.

  Lossy Lossless
What happens to the data Some is discarded for good All of it survives
Typical size Roughly a tenth of the original, often less Roughly half the original
Re-encoding it later Quality drops again every time No further loss, ever
Best for Streaming, phones, anything you just want to play Archiving, editing, masters you will convert again
Examples MP3, AAC, Opus, H.264, HEVC, AV1 FLAC, ALAC, WavPack

Lossy is the right answer for almost everything you watch or listen to casually. Lossless earns its extra size when a file is a source you will process again later, because each round of lossy encoding degrades what the next one has to work with.

If you want that argument settled with real listening tests rather than theory, FLAC vs MP3 goes into it properly, and FLAC Explained covers the archiving side.

Speech Codecs and Audio Codecs Are Not the Same Thing

Music codecs and voice codecs are built for different jobs, and swapping them gives poor results in both directions.

A speech codec assumes it is carrying a human voice, so it can model how a throat and mouth actually make sound and throw away everything that does not fit. That lets it work at tiny bitrates, which is why a phone call uses a fraction of the data a song does.

An audio codec has to handle anything - a cymbal, a cello, a synthesiser - so it cannot make those assumptions and needs more data to sound right.

Opus is the interesting modern case, because it does both and switches between the two modes on the fly. It is what carries most voice and video calls now, and it is why WhatsApp voice messages sound as good as they do at their size.

Hardware or Software Decoding - Why the Same File Behaves Differently on Two Devices

Comparison of hardware decoding running on a dedicated chip and software decoding running on the main processor

Decoding can happen in two places, and which one your device uses explains a lot of odd behaviour.

Hardware decoding hands the work to a dedicated chip built for that specific codec. It is fast, it barely warms the device and it costs almost no battery.

Software decoding makes the main processor do the same maths in general-purpose code. It works on anything, but it runs hot, drains the battery and can stutter on high resolutions.

This is why a 4K clip plays smoothly on a two-year-old phone and chokes on a more powerful laptop - the phone has the right chip and the laptop does not. Our guide to checking whether your PC handles HEVC shows how to find out what yours supports.

The Codec Is Not the File Type

This trips up nearly everyone, and it is worth thirty seconds.

The extension on a file - .mp4, .mkv, .avi - names the container, which is the box. The codec is what the contents are written in. Two files ending in .mp4 can hold completely different codecs inside, which is why one plays and the other does not.

Codecs vs Containers is the full explanation, and it is the page to read if you have a file that refuses to open.

Do You Still Need to Install Codecs?

Far less often than you used to, and this is the biggest change since this guide was first written.

Windows and modern browsers now decode most common formats out of the box, and players like VLC and MPC-BE carry their own decoders internally, so they never touch what Windows has installed. For a lot of people, nothing needs installing at all.

Where you still hit a wall is newer or licence-encumbered formats. HEVC is the usual culprit on Windows, and some AV1 files on older machines.

  • LAV Filters - the clean option. It covers nearly everything and installs only decoders, with nothing else attached.
  • K-Lite Codec Pack - the everything option. Decoders, a player and the tools to configure them, in one installer.
  • AV1 Codec and x265 - worth having if you are encoding rather than just watching.

Do not stack codec packs. Installing two at once is one of the most reliable ways to break playback that was working fine, because they fight over which decoder wins.

Finding Out What a File Actually Uses

If you want to know what is inside a file before you install anything, two options take about a minute.

Codec Finder runs in your browser with nothing to install. MediaInfo does the same job as a desktop app and reports far more detail.

What Codecs Should I Use walks through the identification process step by step if you would rather be led through it.

Where to Go From Here

This page is the concept. For the specifics, the site has a guide for each:

If you would rather just get on with encoding something, LAME handles MP3 and FDK AAC handles AAC.

For lossless, FLAC is the safe default and WavPack is worth a look if you want a hybrid lossy-plus-correction file.

Quick questions

What is a codec, in one sentence?

A set of rules for compressing audio or video into a smaller file and expanding it again for playback. Your player needs the matching rules or it cannot read the file.

Is MP4 a codec?

No, MP4 is a container - the box the file arrives in. The codec is what the video and audio inside it are written in, and an MP4 can hold several different ones.

Do I need to install codecs on Windows 11?

Usually not. Windows handles the common formats already, and players like VLC bring their own decoders, so most people only need something extra for HEVC.

Is lossless audio actually better than lossy?

It is technically perfect, but most people cannot hear the difference at high lossy bitrates on ordinary equipment. Lossless earns its size when you are archiving or converting again later.

Why does one MP4 play and another does not?

Because they contain different codecs. Your device can decode the codec in the first file and not the one in the second, even though both files look identical from the outside.

What is the difference between a codec and a format?

Format is the looser word and people use it for both things. Codec means the compression method specifically, and container means the file structure that holds it.

Should I install a codec pack?

Only if a specific file will not play and you know which decoder it needs. Install one pack, never two, and try a player with built-in decoders first.

Check what your file actually needs with the Codec Finder, or read Codecs vs Containers if something is refusing to play.

LATEST REVIEWS (0)
Be the First to Write a COMMENT!
Verification Code
Click the image or refresh button to get a new code.
Quick heads up: Reviews & comments get a fast check before posting - no spam allowed.
Link copied to clipboard!