Best Compression Format

04 December 2022 version

The best compression format is .7z with the "qs" parameter. As you can see below, this article used to state otherwise. This is because I discovered I was wrong after doing some tests.

Around 28 September 2022, I discovered something strange. An archive with 2 binary-identical files weighing 100 mb would still result in a 200 mb archive. My prime assumption was that the file would be only stored once and the computer would just send the instruction to extract the first file if the second one was selected.

This is a process called deduplication and for some reason it's not on by default. In 7zip the "qs" parameter can be typed in to enable deduplication (this can be done in the UI).

Even if no files are deduplicated, it still appears to offer better compression than .tar.gz.

Technically speaking, the archive format .squashfs is the most optimal out there. That being said it's pretty much exclusive to Linux. While it's possible to extract such an archive on Windows, creating one is seemingly not possible.

The format .squashfs is only superior to .7z by a few negligible bytes. In my opinion .7z is a better choice since it is cross-platform and pretty do the same thing.

Another advantage of .7z is that it doesn't create a nested archive like .tar.gz. This means you can directly read the file from the archive without having to extract a sub-archive first.

Furthermore, it's possible to encrypt such archives with AES, including the file names. This is not possible to do.

Overall, .7z seems to be the superior option. Creating those archives requires 7zip but Winrar seems to be able to read and extract its content.

Written by manpaint on 04 December 2022.

24 August 2022 version

The tar.gz compression format is the most efficient to reduce the size of an archive without any form of data loss. It is widely used by archivists when it comes to archiving files.

On Windows and Linux, tar.gz files can be created using 7zip. You will need to make a .tar file first and then add the file in a .gz archive using the context menu.

This file format provides the result when it is used with text files, but it still save a decent amount of on others file formats.

The only downside is that the tar.gz file type cannot be read by Windows by default. This means that it is not really suitable for general file distributing.

Written by manpaint on 24 August 2022.