How File Compression Works
The main reason for compressing files is to make file transfer over the Internet very quick and easy. Compression programs use algorithms to make files smaller files. The first step the program takes is to examine the file and look for repeating patterns of data. When the algorithm finds patterns of repeating data, it replaces them with smaller “tokens.” Several tokens can be used for large files with many repeating patterns, making the compressed file much smaller than the original. Some compression software can compress several compressed files into an archive file.
A header can be added to the compressed file. It contains information such as the filename, size, and compression method used. This information is used to reconstruct the file when it is decompressed. To decompress a file, your decompression software looks at the file header and tokens. It uses a decompression algorithm to reconstruct the original file.
A common file extension given to files compressed in Windows is .zip. The file extension given for files compressed in a Macintosh is .bin.