Gzip codec (version 1.0)#

Editor’s draft 26 July 2019

Specification URI:


Corresponding ZEP:

ZEP0001 — Zarr specification version 3

Issue tracking:

GitHub issues

Suggest an edit for this spec:

GitHub editor

Copyright 2020-Present Zarr core development team. This work is licensed under a Creative Commons Attribution 3.0 Unported License.


Defines a bytes -> bytes codec that applies gzip compression.

Status of this document#

ZEP0001 was accepted on May 15th, 2023 via zarr-developers/zarr-specs#227.

Document conventions#

Conformance requirements are expressed with a combination of descriptive assertions and [RFC2119] terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in [RFC2119]. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. Examples in this specification are introduced with the words “for example”.

Codec name#

The value of the name member in the codec object MUST be gzip.

Configuration parameters#


An integer from 0 to 9 which controls the speed and level of compression. A level of 1 is the fastest compression method and produces the least compressions, while 9 is slowest and produces the most compression. Compression is turned off completely when level is 0.

For example, the array metadata below specifies that the compressor is the Gzip codec configured with a compression level of 1:

    "codecs": [{
        "name": "gzip",
        "configuration": {
            "level": 1

Format and algorithm#

This is a bytes -> bytes codec.

Encoding and decoding is performed using the algorithm defined in [RFC1951].

Encoded data should conform to the Gzip file format [RFC1952].


[RFC2119] (1,2)

S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119


P. Deutsch. DEFLATE Compressed Data Format Specification version 1.3. Requirement Levels. May 1996. Informational. URL: https://tools.ietf.org/html/rfc1951


P. Deutsch. GZIP file format specification version 4.3. Requirement Levels. May 1996. Informational. URL: https://tools.ietf.org/html/rfc1952

Change log#

No changes yet.