Cookies This site keeps only what it needs to work. There is no analytics and no advertising on it today, and nothing here follows you to other sites. Read the privacy policy

Choose what to allow
+92 312 8299940Free Quote
EN – Language: English
Runs in the browser

Gzip Compressor
Compress And Decompress In The Browser

This gzip compressor packs text or a file into gzip, zlib or raw deflate. It unpacks the same blob again right here. You need no account, nothing is uploaded and no server keeps a copy.

  • FreePrice
  • TwoModes
  • ThreeFormats
  • NoneUploads

Gzip Compressor

Pack and unpack gzip, zlib and raw deflate without leaving the page

Nothing packed yet.

Ready. Paste something, drop a file, or press the sample button.

Your browser does all of the work here, in this tab. We upload nothing, store nothing and log nothing.

Run it on a test page before the live one

Keep a copy of your original code and try the result on a test page before you replace the live file. No automatic tool can see every way your site uses its code.

Add a link to this tool on your own site

Copy the code below and drop it into your page. It places a link to this free tool.

The short version

What A Gzip Compressor Does

The browser-based gzip compressor reduces the size of files and text on-the-fly. To use, simply paste text or upload a file, select gzip, and within seconds the tool will pack the uploaded content into a smaller "blob" format. Your data stays in the page you are using, as all processing takes place locally on your computer. Also, no copy of your data exists anywhere but inside the page you used to create the compressed file.

First, select whether to compress your input to a gzip file or decompress a gzip blob to plain text. You may also alter the compression format to zlib or raw deflate. Also, you will be able to compare the original size of your data with the compressed version, and view the amount of savings as a ratio.

You can get results right away without having to create an account, nor do you have to upload anything. All changes will be reflected in real time, so you can check out the new dimensions of the image you are working with before saving. Once you are satisfied with the results, you can either download the.gz file or copy the base64 encoded version of the output to be used as a parameter in a request, configuration, or note.

This gzip compressor suits anyone who handles compressed data. In fact, developers test an API payload, writers shrink a long log, and students learn how gzip packs bytes without a command line. Because the output matches the standard, it opens in any tool that reads gzip, from a browser to a server, and it stays small on the wire.

One Input, A Smaller Blob

The image below displays your original text to the left, followed by the compressed (gzip) blob generated by the tool on the right. Both images display their respective sizes and savings to the right of each image.

Diagram of the gzip compressor: repeated text compressed into a much smaller gzip blob, then decompressed back
In addition, compress packs the input into a blob and then decompress gives you the exact same bytes back.

Compress uses the browser to compress the input, which is similar to how a server would use gzip to compress it. The reverse button will take the same blob and decompress it back to what you originally had. The Compression Streams API is what actually performs this function.

Choosing Between Gzip, Zlib And Raw Deflate

Each of these devices has exactly the same compressed data. The only difference is what surrounds that data; so, the decision about which device to use will be based upon who reads the data from that device, not how much space you can save.

Gzip compressor packing a 352 byte CSV sample into a 124 byte gzip blob, a 65% saving, shown as base64
The sample packed with gzip, the original size, the new size and the amount saved are listed directly below the output.

If there isn’t an explicit instruction to do differently, use gzip. This is the format that is used by web servers, contained within.gz files, and expected by most command line programs. In addition, the header of a gzip file finds the format of the file, allowing readers to work out this.

Pick zlib when a library asks for it. Its wrapper is two bytes rather than ten, and PNG and some protocols use it. The saving is the same; only the envelope is shorter.

Pick raw deflate only when the other side adds its own framing. It has no header at all, so nothing can verify it, and a blob that arrives without a note is impossible to tell from random bytes.

The only thing that you want to avoid guessing. A GZIP reader will reject a ZLIB blob completely. This tool reads the very beginning of the blob, finds what type of wrapper is being used (GZIP, ZLIB), and returns the name of that wrapper. It does not give you a "header error."

Video guide

Using the Gzip Compressor: A Short Video Guide

This brief video shows each step from start to finish. Choose your language below, and switch on captions if they help.

Step by step

How to compress or decompress with gzip

Six steps, and the data never leaves the tab.

  • Paste in your text or drop a file onto the box

    Type or paste your text, or drag any file into the box. This app will read the text from your computer, so whatever you put there will never leave your machine.

  • Pick compress or decompress

    Choose compress if you want to compress your input, or decompress if you want to decompress an existing gzip blob. You can switch directions of the tool by clicking once.

  • Choose the format

    Stay with gzip as the standard for general use, unless a server or a library is looking for zlib or raw deflate.

  • Read the size and the ratio

    The tool shows the original size, the new size and the saving as a percentage, so you can tell at a glance how well it packed.

  • Pick the output form

    The output can be saved as a.gz file, or copied as base64 or hex text if you plan to save it elsewhere.

  • Download or copy

    Save the.gz file or copy the encoded string. The info will not be submitted to a server and so remains confidential, and the output can then be utilized.

Why this page

Why compress gzip in the browser

Three reasons a browser tool beats a command line for this job.

  • See the size drop as you work

    Gzip compresses files by using a method called "repetition" where it replaces long sequences of identical characters with a single character reference. Since the program displays both the uncompressed file size and the compressed file size side-by-side, you can instantly see how much space was saved when you run the program. This process is generally faster than running a terminal command to work out the same info, and it helps you decide if you want to send the file in its current size or try to reduce its size first.

  • Your data stays private

    This GZIP compressor allows you to skip the typical upload process. Most of the time when you pack your files using an online packer, they take your file and then give you a URL. With this GZIP compressor, the processing occurs directly on your computer; so, if you have a private payload or an unreleased log, it remains private. This means that you may compress a draft configuration or a client export without compromising the integrity of the original source data.

  • The compressed output sticks to the official standard

    The output is just as important as the compression. Since the resulting file is a standard gzip file, any application that supports reading the format will open the file, including a web server or a command-line tool. So, you end up with a file that can be decompressed by a browser. Also, a server can use the same file, and a library can read the file without needing to take an extra action.

Rules of thumb

How gzip actually packs data

The final outcome depends on three different things; so, you should know about all three before compressing.

  • Gzip wraps a deflate stream Gzip is composed of a brief header, a deflate stream, and a checksum at the conclusion of the file. Zlib and raw deflate use the same internal engine as a result of the deflate portion performing most of the compression. Also, the checksum enables readers to work out if the data was corrupted during transfer. Thus, the format is compact and secure. So, simply choose the wrapper that the recipient will expect and the compressed data remains consistent.
  • Text shrinks far more than media Gzip loves repetition. Because text, JSON and logs repeat the same words and symbols, they often shrink by half or more. However, a photo, an MP3 or a ZIP is already packed, so gzip finds little to remove and the saving is tiny. Therefore compress the text and leave the media alone, since a second pass rarely helps.
  • The result is bytes, not letters Gzip blobs are not human-readable text; they are made up of binary data. A single raw byte can be broken if you paste it into a web-based form. To avoid this, our tool allows users to view their output as either Base64 or Hexadecimal, both of which can be sent as plain text without being corrupted. In addition, decompressing a file will result in the same sequence of bytes as before compression. As such, a user’s original file is restored exactly as it existed before compression, including each individual byte.
Careful here

Gzip mistakes that trip people up most often

Each of these wastes time or corrupts the file, making them difficult to notice.

  • Compressing an already-packed file

    A JPEG, an MP4 or a ZIP will barely shrink when compressed, as they have already been compressed. For all practical purposes, use Gzip for your text, JSON and log files; do not compress your media.

  • Mixing up gzip and zlib

    In order for a gzip reader to accept a zlib wrapped blob, the two blobs must have different header types. So, when sending a blob to a remote machine, make sure to work out what type of reader will be processing the blob so that the appropriate format is used.

  • Pasting raw bytes as text

    When binary output is placed into a text box or a JSON field, it will be broken. But, if you convert the binary output to base64 or hex format before copying, those formats can be pasted anywhere and will remain undamaged.

  • Expecting a tiny input to shrink

    Gzip adds a small header and a checksum, so a very short string can come out larger. Because the overhead is fixed, compression only pays off past a few hundred bytes.

  • Losing the original

    Compression can be undone, but if a blob becomes corrupted, then there’s no way to undo that. As such, make sure to save the original data until after you’ve successfully uncompressed the output file and verified that the output matches the input.

  • Trusting the ratio of one sample

    One file isn’t the norm. To make sure that your promise for savings is accurate and will remain valid during full-scale operation, test a realistic sample of your payload before making any commitments about potential savings.

Questions

Questions people ask about the gzip compressor

Does the gzip compressor send my data to a server?

No. Actually, the entire task is performed in your browser. So, your text/file will never be sent to a server, as the program doesn’t need a server to perform compression/unpacking of the data.

What is gzip?

Gzip is a compression method which creates a compressed version of a file by adding a short header, a deflate stream, and a checksum to the original file. Since gzip is a common standard, any program that can read gzip files can also read the compressed file created using gzip. This explains why the web utilizes gzip extensively.

Does the tool compress and decompress?

Both directions are possible. Since the tool can run in either direction, you have the option of compressing text into a gzip blob, or decompressing a blob back into its original text. In reality, switching directions is as simple as clicking a button.

How do gzip, zlib and deflate differ?

Under the hood, each of them uses the same deflate engine. However, gzip adds a header and a checksum, zlib uses a shorter wrapper, and raw deflate has no wrapper at all. Therefore pick the one the other side expects, since the packed bytes are otherwise the same.

Can I compress a file, not just text?

Indeed, you can drag and drop a file into the box and the tool will read it from your computer and package it similarly to all other inputs. When finished, you have the option of downloading the smaller.gz version of the file or copying the data as text.

Can I download the result as a.gz file?

Yes, because the output is in the form of a typical gzip blob, you can save the output as a.gz file which can be opened by any gzip reader. Save files usually go directly to either a server, a build step, or a shell command.

Is it possible to copy the output as text?

Yes. Compressed data is binary and so the tool can display the compressed data in either base64 or hex format. These formats are transmitted over networks using only character based protocols. This means that you can copy/paste the output from this tool directly into a request body, configuration file, or message with no corruption issues.

How much smaller will gzip make my data?

That depends on what the content looks like. Because gzip packs repetition, plain text and JSON often shrink by half or more. However, a file that is already compressed barely changes, so the saving on media is small.

Why is my file larger after compression?

A short input may result in an output which is slightly larger than what went into the compressor due to the small header and checksum that gzip adds to every file. For this reason, compression typically does not pay off until the file being compressed has reached at least a couple of hundred bytes.

Does the gzip compressor cost anything?

Yes, completely. No account needed. No trial period. Everything works on your computer, so there are no costs for servers. That means everything remains free.

Does it work offline?

Once the page loads, each of your compressions and decompressions take place on your local machine. So, you may disconnect from the internet and continue using the tool, as it will never contact a remote server.

Can I compress JSON?

Yes, and gzip can handle that task quite effectively. Since JSON uses the same keys and symbols repeatedly, there is much for gzip to find to compress; so, a JSON payload will usually shrink significantly. For example, in real-world applications, you should clean up your JSON before compressing it so that your requests are smaller.

Is my data kept by the tool?

No, nothing is saved to a server or in local storage. So, when you close your browser tab, all of your data will be gone. Please make sure that you have either downloaded or copied the results of your work before closing your browser tab.

Can I decompress a.gz file someone sent me?

Yes. Because the tool reads a gzip blob, you drop the file, pick decompress, and it unpacks to the original text. However, if it fails, the blob may be zlib or raw deflate, so switch the format and try again.

What does the compression ratio actually measure?

The ratio shows the relationship between the current size of the product and its initial size. This is expressed in terms of the percentage that can be saved. Since the smaller the percentage of the original size, the larger the potential savings, the percentage will give an immediate indication of whether the buy of the pack is justified.

Will the gzip compressor work on my phone?

Yes, you can compress using either a phone or a tablet due to the fact that the page will adapt to fit a smaller screen. But, you can drop large files more easily on a computer; so, a phone would be best for performing a quick text job.

Is gzip lossless?

Yes. Because gzip only packs the data and never drops any of it, decompress returns the exact bytes you started with. Unlike image or audio compression, nothing is thrown away to save space.

Why is gzip used so much on the web?

The reason a server may use gzip to reduce the size of the data being transmitted over the network is because the browser will un-compress (un-gzip) that data before displaying the webpage. As such, since text, HTML and JSON are typically very compressible, using gzip can increase website speed while maintaining the same experience for the user.

Is it possible to choose the compression level?

That comes down to your browser. Because the built-in streams use one solid level, the saving is close to the best in most cases. A higher level saves a little more for more time, but for everyday text the default is enough.

Does the tool add a watermark or change my data?

No. The output of the command will be a "clean" gzip blob that contains all the exact same bytes that you given to the command. There is no addition or branding of the output since gzip is a lossless compression algorithm and the tool only compresses the exact bytes that you given.

Does the tool track me or read my data?

No. In fact, your info is never transmitted to another location, and there isn’t any analytical software that examines it. So, the compression of your document occurs on your computer as nothing related to your document leaves the site.

Keep going

More tools for data and text

A few pages the same job usually leads to.

Compress your first file now

Start by opening the gzip compressor. Paste your text or drag a file into the compressor. Then, select either compress or decompress. As you use the compressor, the size will update. Finally, click once to save the results. All of this occurs on your device; no data is sent outside of it.

Prefer Denwix on GoogleReview Denwix on Google