Skip to the tool
ViewCSV
Files stay on your device

Compress CSV

Drop a CSV, .gz or .zip file here
Action
The file’s bytes are compressed as they are, so restoring gives back exactly the same file: encoding, byte-order mark and line endings included.
Open a file to compress or restore.

Open a CSV and choose gzip or ZIP, and the compressed file downloads as soon as it is ready: orders.csv becomes orders.csv.gz or orders.zip. To go the other way, open a .gz or .zip file and restore it to the files inside. The bytes are not parsed or changed, so encoding, delimiter, quoting, line endings and any byte-order mark come back exactly as they were. Compression runs in your browser; the file is never uploaded.

How to compress or restore a CSV

  1. Open or drop a file. A file ending in .gz or .zip switches the tool to restore; anything else is compressed.
  2. Choose gzip or ZIP and a compression level from 1 to 9. The default, 6, is the usual balance of size and time.
  3. Start the job. The result downloads, and the tool shows the size before and after and the ratio between them.

Gzip or ZIP?

Gzip (.csv.gz)One compressed file, defined in RFC 1952. Command-line tools, data warehouses and many import pipelines read .csv.gz directly. The original file name is stored inside.
ZIP (.zip)An archive with one entry under the original file name. Opens with a double-click on Windows and macOS, so it suits email attachments and people without command-line tools.
Compression level1 takes the least time and 9 works hardest for a smaller file. On typical CSV the difference between 6 and 9 is small, and on a small file there may be none.
RestoreA .gz file gives back the one file inside. A .zip gives back every file it contains; folders are skipped and folder paths are dropped from the names. A single file downloads straight away; several are listed with a download button each.

Compressing the same file at the same level gives identical bytes every time, because the timestamps written into the gzip header and ZIP entries are fixed rather than the current time. That makes the output safe to checksum or keep in version control.

What is kept exactly

  • The file is treated as bytes, not as a table, so nothing is re-encoded: a Windows-1252 or Shift_JIS export, a semicolon delimiter, CRLF line endings and a UTF-8 byte-order mark all restore unchanged. Leading zeros and long IDs are untouched because no value is ever read.
  • Quoted line breaks and stray quotes don't matter to compression; even a malformed CSV is compressed and restored as it is. To check the file itself, use Validate CSV.
  • Gzip stores the name in Latin-1, as RFC 1952 requires, so a file name in another script, such as Chinese or Cyrillic, may not come back intact. Use ZIP for such names, or rename the file after restoring.
  • When a ZIP contains two files with the same name in different folders, both are restored under that name. Rename them as you download them.

Troubleshooting

  • This is not a gzip or ZIP file. The file's first bytes are not a gzip or ZIP signature; it may be a plain CSV with a .gz name, or another archive type such as 7z or RAR. Switch to gzip or ZIP to compress it instead.
  • The gzip data is damaged or incomplete. The checksum or length stored at the end of the file doesn't match, which usually means the download was cut off. Fetch the file again.
  • The ZIP data is damaged or uses an unsupported method. Only stored and Deflate entries can be restored; methods such as Deflate64, BZIP2 or LZMA are not supported. Password-protected ZIP files aren't supported either: extract them with an archive tool that asks for the password.
  • The compressed file is barely smaller. CSV with many distinct values, such as random IDs or hashes, compresses less than repetitive data, and very small files gain little because the format adds a fixed header. Converting to Parquet can shrink typed, columnar data further.

Large files and privacy

There is no 25 MB limit here, because the file is never loaded as a table: it is read in 4 MB chunks and compressed or restored as a stream. Restoring stops with an error once the restored data would pass 4 GB in total, which protects the tab from “zip bombs” that expand to enormous sizes.

The work runs in a background worker in this tab and Cancel stops it. Nothing is uploaded. To make a large file smaller by cutting it into pieces instead, use Split CSV, which can also download the parts as one ZIP.

Example

A 12-row order export with semicolons, decimal commas and leading-zero SKUs (first rows shown), 374 bytes in total. Gzip gives the same 185 bytes at levels 1, 6 and 9 because the file is so small; ZIP adds a larger archive header. Restoring either file returns all 374 bytes unchanged.

CSV
order_id;region;sku;qty;amount
SO-1001;North;00123;1;19,90
SO-1002;South;00124;2;38,90
SO-1003;East;00125;3;57,90
SO-1004;West;00123;4;76,90
…
Result
orders-march.csv.gz   185 bytes (49.5 %), restores to orders-march.csv
orders-march.zip      296 bytes (79.1 %), one entry: orders-march.csv
Restored orders-march.csv   374 bytes, identical to the original

Questions and answers

Can I compress several CSV files into one ZIP?

Not on this page: it compresses one file at a time. Split CSV downloads all its parts as one ZIP, and restoring a ZIP here gives back every file inside.

Is a .csv.gz file still a CSV?

It is a CSV compressed with gzip. Tools that support gzip, such as gunzip, most databases' import commands and data libraries, read it directly; others need it restored to .csv first, which this page does.

Does compression change my data?

No. Gzip and ZIP compression are lossless and this tool never parses the CSV, so the restored file is the same sequence of bytes as the original.

Standards and references