Skip to content
Marvin's Toolbox.

Data Compressor

Compress text or a file with gzip, deflate, brotli or Zstandard and see the size before and after, the compression ratio and how long it took. One click tries every method and recommends the smallest result.

Runs entirely in your browser. Nothing you put in here gets uploaded.

Input

Method

Compression method
Level6

0 is fastest, 9 compresses hardest.

Add some text or a file first.

Next steps

Send this tool's output straight into another tool.

Decompress gzip, deflate, brotli or Zstandard data from a file or pasted Base64 and read the result as text or download it. Detects the format from the magic bytes where possible, with a manual override.

Hash text or a file with MD5, SHA-1, SHA-256, SHA-512, SHA-3, BLAKE2, BLAKE3, CRC32 and more, all computed live as you type. Compare against an expected checksum and copy any digest.

Verify a file against its checksum. Drop the file and paste the expected hash or a sha256sum line, and the hash type is detected for you, from MD5 to BLAKE3.

Compress text or a file with gzip, deflate, brotli or Zstandard and see the size before and after, the compression ratio and how long it took. One click tries every method and recommends the smallest result.

Inspect any file or text as a hex dump with offsets, byte values and an ASCII column. Jump to an offset, search for bytes or text, select a range to see it decoded as integers and strings, and copy or download the dump.

Encrypt any file with a password using AES-256-GCM, or decrypt a file that was encrypted here. Strong key derivation and integrity protection built in.

Decode Protocol Buffers, MessagePack and CBOR data without a schema. Paste hex or Base64, or drop a file, and see every field as a tree mapped back to its bytes, then copy the result as JSON.

Run real SQL on your own data with SQLite. Open a CSV, JSON or .sqlite file, or paste a table, and query it with joins, aggregates and window functions. Browse the schema, export results as CSV or JSON, and download the database.

Decode any DER or PEM data into a browsable ASN.1 tree with named object identifiers and a linked hex view. Open PKCS#12 .p12 and .pfx bundles with their password to list the certificates and keys inside, and export them as PEM.

About the Data Compressor Tool

This tool compresses text or a file with gzip, deflate (zlib), raw deflate, Brotli or Zstandard and shows exactly what you gained: the size before and after, the percentage saved, the compression ratio and how long the codec took.

Not sure which method to pick? One click on Find best method runs all five over your data and recommends the smallest result. You can then forward the output straight to the Data Decompressor to verify the round trip.

What you can do

  • Compress text or any file with gzip, deflate, Brotli or Zstandard.
  • Compare every compression method on the same data and pick the smallest result.
  • Measure the compression ratio and speed of gzip, Brotli and zstd.
  • Download the result with the right extension (.gz, .zz, .deflate, .br or .zst).
  • Copy small results as Base64 for configs, tickets or tests.

How to use the Data Compressor

  1. 1Paste text, or switch to File and drop any file.
  2. 2Pick a method and set its level or quality, or press Find best method to try them all.
  3. 3Read the before and after sizes, the space saved, the ratio and the time taken.
  4. 4Inspect the compressed bytes in the hex view, download the file, or copy it as Base64.

Choosing a method

gzip is the safe default, every tool and server understands it. Brotli usually produces the smallest output for text and web assets but takes longer at high quality. Zstandard gets close to Brotli while compressing and decompressing much faster, which is why it is popular for build artifacts and backups. deflate (zlib) and raw deflate are the same algorithm gzip uses, just with a lighter or no container, for when a spec asks for exactly that framing.

How Find best method works

Find best method runs every codec over the same input at its strongest practical setting: level 9 for gzip and the deflate variants, quality 11 for Brotli and level 19 for Zstandard. The results are sorted by size, the smallest is highlighted and adopted as the active result, and each row reports its timing so you can trade a few percent of size against speed.

When compression makes data bigger

Already compressed data such as JPEG photos, video or ZIP archives has little redundancy left, so a second pass often grows it slightly. The tool reports that honestly as a negative saving instead of hiding it. Random or encrypted data behaves the same way.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • fflate

    A fast and small JavaScript implementation of gzip, zlib, deflate and ZIP.

  • brotli-wasm

    Google's Brotli compression, compiled to WebAssembly.

  • zstd-wasm

    A WebAssembly build of Zstandard, the fast modern compression format.

Everything this site builds on is listed on the credits page.

Tools that share a tag with this one.

Decompress gzip, deflate, brotli or Zstandard data from a file or pasted Base64 and read the result as text or download it. Detects the format from the magic bytes where possible, with a manual override.

Shrink an SVG with SVGO. Paste the markup or drop a file, toggle every optimizer plugin individually, set the numeric precision and multipass, and compare the size before and after. Copy the result or download it as a file.

Decode any DER or PEM data into a browsable ASN.1 tree with named object identifiers and a linked hex view. Open PKCS#12 .p12 and .pfx bundles with their password to list the certificates and keys inside, and export them as PEM.

Enter a resolution to get its simplified aspect ratio, or start from a ratio and one side to get the missing dimension. Knows the common ratios like 16:9, 4:3 and 21:9 and shows how close your size is to each.

Create barcodes in dozens of formats, from EAN-13, UPC-A and Code 128 to QR Code, Data Matrix and PDF417. Type the content, tune the size, colors and text options, and download the result as PNG or SVG.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.