DecompressionStream: readable property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since May 2023.

Note: This feature is available in Web Workers.

The readable read-only property of the DecompressionStream interface returns a ReadableStream that emits decompressed data as Uint8Array chunks.

Value

A ReadableStream.

Examples

This example creates a DecompressionStream that performs gzip decompression. It writes some compressed binary data to the writable stream, then reads the decompressed data from the readable stream, decoding it as UTF-8 text.

js
const stream = new DecompressionStream("gzip");

// Write data to be compressed
const data = Uint8Array.fromBase64(
  "H4sIAAAAAAAAE/NIzcnJ11Eozy/KSVEEAObG5usNAAAA",
);
const writer = stream.writable.getWriter();
writer.write(data);
writer.close();

// Read compressed data
const reader = stream.readable.getReader();
let done = false;
let output = [];
while (!done) {
  const result = await reader.read();
  if (result.value) {
    output.push(...result.value);
  }
  done = result.done;
}
console.log(new TextDecoder().decode(new Uint8Array(output))); // Hello, world!

Specifications

Specification
Streams
# dom-generictransformstream-readable

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
readable
Chrome – Full support
Chrome 80 (Release date: 2020-02-04)
footnote Full support
Edge – Full support
Edge 80 (Release date: 2020-02-07)
footnote Full support
Firefox – Full support
Firefox 113 (Release date: 2023-05-09)
footnote Full support
Opera – Full support
Opera 67 (Release date: 2020-03-03)
footnote Full support
Safari – Full support
Safari 16.4 (Release date: 2023-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 80 (Release date: 2020-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 113 (Release date: 2023-05-09)
footnote Full support
Opera Android – Full support
Opera Android 57 (Release date: 2020-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 80 (Release date: 2020-02-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 16.4 (Release date: 2023-03-27)
footnote Full support
Bun – Full support
Bun 1.3.3 (Release date: 2025-11-21)
footnote Full support
Deno – Full support
Deno 1.19 (Release date: 2022-02-17)
footnote Full support
Node.js – Full support
Node.js 17 (Release date: 2021-10-19)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also