List Compressor

Compress a list's text using the browser-native CompressionStream("gzip") API, producing genuine, RFC 1952-compliant gzip bytes you can download as a .gz file, alongside the original and compressed sizes for comparison. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

Large lists, IDs, log lines, dictionary words, can get unwieldy to store or transmit as plain text, and a lot of online "compressors" turn out to be fake, just stripping whitespace and calling it compression.

This tool does real gzip compression entirely in your browser, using the same DEFLATE-based algorithm as the standard gzip utility, and gives you an actual downloadable .gz file plus honest size numbers.

What Is List Compressor?

The List Compressor takes your list's text and runs it through the Web Platform's native `CompressionStream("gzip")` API, which produces byte-for-byte standard gzip output.

It's not a text-shrinking gimmick, whitespace trimming or deduplication, it's the real DEFLATE compression algorithm wrapped in a proper gzip header, footer, and CRC32 checksum.

How List Compressor Works

The list is split on your chosen separator, trimmed, and rejoined with newlines into a single text block, which is then UTF-8 encoded to bytes.

Those bytes are piped through `CompressionStream("gzip")`, and the resulting compressed byte stream is collected into a downloadable `.gz` file, with the original and compressed byte counts both reported.

When To Use List Compressor

Use this when you want to shrink a long list, IDs, log entries, word lists, before storing or transmitting it, and want a real gzip file rather than a cosmetic trim.

It's also useful for demonstrating how much (or how little) a given kind of list data actually compresses, since the tool shows real before/after sizes.

Features

Advantages

  • Produces genuine gzip output, verifiable by decompressing it with any standard gzip-aware tool.
  • Runs entirely client-side using a native browser API, no data leaves your machine.
  • Shows honest original-vs-compressed size numbers instead of hiding when compression doesn't help.

Limitations

  • Very short or already-random-looking lists may not shrink, and can even grow slightly due to gzip's fixed per-file overhead, this is a property of gzip itself, not a bug.
  • Requires a browser that supports the `CompressionStream` API (all current major browsers do); there's no server-side fallback since this tool runs entirely client-side.

Examples

Compressing a repetitive list

Input

apple
apple
apple
banana
banana
cherry

Output

(binary .gz file, ~20-30% smaller than the original text)

Repeated items give DEFLATE's dictionary-matching real structure to exploit, so the compressed output is noticeably smaller.

Compressing a short, unique list

Input

x1
y2

Output

(binary .gz file, likely larger than the original text)

Gzip's fixed header/footer/checksum overhead (about 20 bytes) can outweigh the savings on a tiny, non-repetitive list, so the .gz file ends up bigger, which the tool reports honestly rather than hiding.

Best Practices & Notes

Best Practices

  • Check the reported compressed-vs-original size before assuming compression helped, for small lists it sometimes doesn't.
  • Use this for genuinely large lists, hundreds or thousands of items, where gzip's savings are most meaningful.

Developer Notes

Uses `new CompressionStream("gzip")` piped through a `ReadableStream`/`Response` (the same pattern as this codebase's PNG-to-PDF `deflate()` helper, but with the "gzip" format instead of "deflate" so the output includes the gzip magic bytes, header, and CRC32 trailer), producing real RFC 1952 gzip bytes assembled into a downloadable Blob.

List Compressor Use Cases

  • Shrinking a large word list or ID list before archiving it
  • Demonstrating real gzip compression ratios for different kinds of list data
  • Producing a .gz test fixture for a script or service that needs to handle gzip input

Common Mistakes

  • Expecting every list to shrink significantly, compression ratio depends entirely on how repetitive the data is; random or very short lists may not benefit.
  • Assuming this tool does anything other than real gzip, it deliberately doesn't try to be clever about deduplication or trimming, that's a different kind of tool.

Tips

  • If you need maximum compression on a huge list, sorting similar items together first can sometimes improve DEFLATE's ability to find repeated patterns.
  • The downloaded .gz file is a standard gzip stream, so `gunzip filename.gz` on the command line will decompress it back to plain text.

References

Frequently Asked Questions