Lossless data compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data. by contrast, lossy data compression permits reconstruction only of an approximation of the original data, though this usually improves compression rates (and therefore reduces file sizes). lossless data compression is used in many applications. for example, it is used in the zip file format and in the gnu tool gzip. it is also often used as a component within lossy data compression technologies (e.g. lossless mid/side joint stereo preprocessing by the lame mp3 encoder and other lossy audio encoders). lossless compression is used in cases where it is important that the original and the decompressed data be identical, or where deviations from the original data could be deleterious. typical examples are executable programs, text documents, and source code. some image file formats, like png or gif, use only lossless compression, while others like tiff and mng may use either lossless or lossy methods. lossless audio formats are most often used for archiving or production purposes, while smaller lossy audio files are typically used on portable players and in other cases where storage space is limited or exact replication of the audio is unnecessary.