An algorithm was proposed to compress losslessly the SEG-Y and miniSEED Files. It describes the distribution of SEG-Y and miniSEED files using Gini coefficient. Different data sub-groups should use different compression algorithms. The improved algorithm can achieve a better compression ratio of 75–80%. It provides a better compression ratio than the Steim2 to miniSEED Files.