Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimum File Size for Compression Algorithms

Tags:

compression

I know that for small files sometimes the compressed format can actually be larger than the initial file size.

Are the minimum file sizes known for popular compression libraries such as gzip and lz4?

I am dealing with files that are ~ 384 bytes.

like image 437
bzak Avatar asked Apr 07 '26 12:04

bzak


1 Answers

This can be easily determined through experimentation. The smallest file that can be compressed by gzip is 24 bytes of zeros down to 23 bytes. The smallest lz4 can do is 31 bytes of zeros down to 30.

like image 115
Mark Adler Avatar answered Apr 12 '26 14:04

Mark Adler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!