Web APIs

Compression Streams

Checking compatibility...

Provides a JavaScript API for compressing and decompressing streams of data using the gzip or deflate formats. Built-in compression means that JavaScript applications will not need to include a compression library, reducing the download size.

Basic Compression

This example shows how to shrink text data using gzip compression, making it much smaller for efficient storage or transmission over the network.

=
=
=
=
=
=

Output

Click Run to see output...

Basic Decompression

This example demonstrates how to restore compressed data back to its original form, allowing you to work with data after it's been received in compressed format.

=
=
=
=
=
=

Output

Click Run to see output...

Compression Visualization

This example shows the complete compression process from start to finish, including converting the compressed data to a format that can be easily stored or transmitted.

=
=
=
=
=
=

Output

Click Run to see output...