The word "codec" comes from the combination of two words, code and decode.

As the name suggests, a codec is a method of coding and decoding data. Each codec contains a set of rules and steps for taking raw data and encoding it into another format, or taking encoded data and decoding it. Codecs are used most often to compress large amounts of data, encrypt secret data, or index messy data. Data that has been encoded is usually no longer usable by normal means and it must be decoded with a codec before it's used.

Codecs are necessary to store and view data in special formats like MP3, RLE, and AVI.

Although primarily used when speaking about computers, a codec actually refers to any set of rules for coding and decoding data. This includes such things as magic decoder rings, letter to number ciphers, and various other congenital methods.