Compression guides

Compare the ZIP and GZIP Versions of a Binary File

·

Choose the format your recipient can reopen. Use the saved size to compare ZIP and GZIP on the same source, then check that each one restores the complete file.

Binary File Compressor

Compress the 4,096-byte sensor fixture

Choose Load worked example. The file is sensor-frame.bin and the input is 4,096 bytes. Select ZIP level 6 and compress it. Download sensor-frame.bin.zip and open the sensor-frame.bin entry in a ZIP reader.

The restored entry is 4,096 bytes. Its first four decimal byte values are 0, 9, 18 and 27. The binary pattern repeats, so a ZIP reader can restore data that includes zero and high byte values.

Open the Binary File Compressor worked examplePKWARE ZIP File Format Specification

Reopen the same source as GZIP

Select GZIP and compress the same file. Download sensor-frame.bin.gz and decode it with a GZIP reader. Compare the decoded bytes with the ZIP entry. They are the same 4,096 bytes even though the saved archive sizes can differ.

Check the full output byte count before sending an attachment. ZIP stores a named entry and directory information. A GZIP stream has a wrapper and trailer without a ZIP entry directory.

PKWARE ZIP File Format SpecificationRFC 1952 GZIP file format

Interpret a negative size reduction

Try a tiny file or data that is already compressed. If the output is larger, the result shows the measured growth. Compare the archive byte count with your transfer limit instead of relying on a fixed reduction estimate.

ZIP uses one root entry. For an unsafe filename, the tool uses payload.bin. Check the displayed entry name if the destination expects a particular filename.

PKWARE ZIP File Format SpecificationRFC 1952 GZIP file format

Common questions

Can I compress a database file without opening the database?

The workspace treats a local database as file bytes. The recipient can recover those bytes with a compatible ZIP or GZIP reader.

Which format can hold several files?

Use a ZIP creation tool for multiple archive members. This workspace compares the ZIP and GZIP results for one file.

Sources

Put it into practice.

Related guides