What’s file compression?

Print anything with Printful



File compression reduces the size of electronic files by replacing repeating sequences with smaller ones. Compression programs use algorithms to create a dictionary for the zipped file. Self-extracting files open automatically, but are larger than normal compressed files.

File compression is a method used by computers to reduce the size of an electronic file or group of files to the smallest possible size. ZIP files are a common example of file compression. There are many techniques that computer programs use to compress files, but the most common method is to replace repeating sequences with smaller sequences. Computers do this by cataloging the first instance and referencing it in subsequent instances. For example, in the sentences preceding this one, the letters “compress” appeared three times. A computer could compress them by cataloging the first instance and equating all subsequent instances with “&cmp”, thus reducing the number of letters or characters required and the file size. Over a large file, such a replacement can save a lot of space. It should be noted, however, that the user does not see this – the computer does all the work in the background.

To keep track of shortened substitutions, computer programs also create a dictionary for the zipped file. In the world of file compression, a dictionary is a list of the original sentences and their replacements. However, this dictionary is included in the file size, so it will also take up space, reducing the amount of space saved by compression. For this reason, it is usually less efficient to compress a single small file than a large file or group.

Programs that perform file compression work in slightly different ways. These differences are mostly the result of something called an algorithm. An algorithm is a mathematical construct that searches files for repetitions and inserts simple references. Programmers create the compression algorithms and define the templates and substitutions to be used for compression. Variances can affect the efficiency of the compression. For example, in the sentence “it was the best of times, it was the worst of times”, the sequences “it was the” and “the first of times” are repeated. A programmer may choose to replace each full sentence or perhaps replace “it” individually and “of times” individually. These slight differences in algorithms are why some file compression programs work better on some file types than others.

Some types of compressed files are self-extracting, which means they open automatically when a user clicks on them—no external programs are needed to decompress them. To create these files, the original compression program must add additional code to the compressed file. For this reason, a self-extracting compressed file is often larger than the same file if it were compressed normally. This is typically considered a good compromise for companies that release programs for you to install on home computers. By making the file self-extracting, it allows the home user to skip a step and makes installing the software more likely. To decompress files that are not self-extracting, a variety of third-party programs can be downloaded from the Internet.




Protect your devices with Threat Protection by NordVPN


Skip to content