Staaarter

CSV Decompressor

Decompresses gzip-compressed CSV data using the browser-native DecompressionStream("gzip") API, accepting either a .csv.gz file upload or a pasted base64-encoded gzip string, and shows the recovered CSV text ready to copy or download. A free online tool from Staaarter, right in your browser.

By Staaarter Team
csvcompressiongzip
Runs locallyUpdated 2026-08-06

Overview

Introduction

If you've got a .csv.gz file, whether from CSV Compressor or anywhere else, you eventually need to look at the CSV text inside it. This tool gunzips it entirely in your browser.

It handles two real-world cases: a real .csv.gz file you can drop in directly, or a base64 text copy of those same gzip bytes that you need decoded back to bytes first.

What Is CSV Decompressor?

A gzip decompressor built on the Web Platform's native DecompressionStream("gzip") API, the literal inverse of CSV Compressor's CompressionStream("gzip") step.

It accepts input two ways: a direct .csv.gz file upload, or a pasted base64-encoded string representing the same compressed bytes, both end up decompressed into the same plain CSV text output.

How CSV Decompressor Works

For a file upload, the browser's File object is read into raw bytes via arrayBuffer(), then piped through DecompressionStream("gzip") using the same ReadableStream/Response pipeline pattern CSV Compressor uses in reverse.

For pasted base64, the text is first decoded back into bytes with atob() and Uint8Array.from(), then handed to the exact same gunzip step, so both paths converge on identical decompression logic.

When To Use CSV Decompressor

Use this whenever you have a .csv.gz file and need to see or edit the CSV text inside it without a command-line gunzip.

It's also the natural pairing for CSV Compressor's base64 text output, when you want to verify round-tripping without ever leaving the browser.

Often used alongside CSV Compressor.

Features

Advantages

  • Runs entirely client-side using a native browser API, your compressed data never leaves your machine.
  • Handles both a real binary .csv.gz upload and a base64 text paste, covering how gzip data actually shows up in practice.
  • Reports a clear, friendly error instead of a raw exception when the input isn't valid gzip.

Limitations

  • Only understands gzip-format compression, not zip, brotli, or other archive formats.
  • Very large decompressed CSVs are held fully in memory as a single string, which can be slow for extremely large files.

Examples

Round-tripping with CSV Compressor

Input

(a .csv.gz file downloaded from CSV Compressor)

Output

id,status
1,active
2,active
3,active
4,inactive

Uploading the .csv.gz file recovers the exact original CSV text, since gzip decompression is lossless.

Best Practices & Notes

Best Practices

  • Use the file upload path whenever you actually have a .csv.gz file, it's the more direct route.
  • Reach for the base64 paste path only when you specifically have a base64 text copy of gzip bytes, not a real file.
  • If decompression fails, double check the file extension and that the base64 text wasn't truncated when copied.

Developer Notes

decompressGzipBytes() pipes a Uint8Array through `new DecompressionStream("gzip")` inside a `ReadableStream`/`Response` pipeline (the mirror image of csv-compressor.ts's gzip() helper) and reads the result back as text via Response.text(); decompressBase64Gzip() decodes base64 to bytes with `Uint8Array.from(atob(base64), c => c.charCodeAt(0))` first, then delegates to decompressGzipBytes(), and both paths report a friendly error string rather than letting the DecompressionStream exception propagate.

CSV Decompressor Use Cases

  • Recovering the original CSV text from a .csv.gz file without a command-line tool
  • Verifying a CSV Compressor round trip by decompressing what it just compressed
  • Decoding a base64 copy of gzip bytes (pasted from elsewhere) back into readable CSV

Common Mistakes

  • Pasting a .csv.gz file's raw bytes as text into the base64 box, that box expects base64-encoded text, not raw binary.
  • Assuming any upload failure means the file is corrupted, sometimes it just isn't gzip data at all (e.g. a plain .csv renamed to .csv.gz).

Tips

  • Keep CSV Compressor's base64 output panel open in another tab if you're testing a round trip, it's a fast way to generate valid input here.
  • Once decompressed, send the CSV straight into CSV Editor to start making changes.

References

Frequently Asked Questions