What Is Blosc2?

Blosc2 is a high-performance meta-compressor, open data container format, and compressed compute engine optimized for binary data. As the successor to the original Blosc library, it is designed for speed by leveraging multi-threading and SIMD instructions (SSE2, AVX2, AVX512, NEON, ALTIVEC). It uses a blocking technique to divide datasets into blocks that fit in CPU caches, dramatically reducing memory bus activity and breaking down memory walls.

With a large diversity of lossless and lossy codecs and filters, Blosc2 lets developers fine-tune the balance between compression speed and ratio. It is a mature, BSD-licensed open-source project seeing 2–4 million monthly downloads in Python, and is integrated into foundational scientific and AI tools including PyTables, h5py (via hdf5plugin), Zarr, and deep-learning pipelines such as DKFZ's nnU-Net.

Watch this introductory video to learn more about the foundations of Blosc2:

Core Compression & Storage

  • Optimized for Binary Data: Uses shuffle, bit-shuffle, byte-delta, and precision-truncation (TRUNC_PREC, INT_TRUNC) filters that leverage data type information to improve compression ratios, with minimal overhead (max 32 bytes per chunk) on non-compressible data. Supports both lossless and lossy compression, including ZFP for multidimensional data and Grok/OpenHTJ2K (JPEG 2000) for scientific imaging.

  • Multi-platform C Core: Written in C (C-Blosc2 3.x) for Linux, macOS, Windows, and WebAssembly (WASM), with rich Python bindings and smart thread scheduling that eliminates unnecessary parallel startup overhead on small compression requests.

  • Large Persistent Containers: Supports datasets up to 2^59 bytes (1/2 exabyte) via 64-bit super-chunks, backward-compatible variable-length super-chunks, memory-mapped (mmap) access, and Frames for serializing data in memory or on disk.

Modern Data Containers

  • Columnar Tables (CTable) & Indexed Queries: CTable is a compressed columnar table built on NDArray and ListArray, supporting typed schemas, nullable columns, Arrow-compatible utf8() strings, nested lists/structs, virtual and materialized columns, and zero-copy mask-based where() views. Automatic block-level min/max statistics and explicit indexes (FULL, BUCKET, PARTIAL) prune irrelevant blocks so selective queries in .b2z files dramatically cut both I/O and CPU work.
CTable compressed columns and selective queries
  • Hierarchical Stores (TreeStore / .b2z): Organize multiple arrays, tables, indexes, and variable-length metadata (vlmeta) in a filesystem-like hierarchy via TreeStore, stored in compact single-file .b2z archives or .b2d directories.

Computing Directly on Compressed Data

  • High-Speed Lazy Compute Engine: Python-Blosc2 is far more than a compression wrapper. Its lazy evaluation engine—accelerated by miniexpr in Python-Blosc2 4.0—streams cache-sized blocks directly through the CPU without decompressing entire datasets into RAM. It supports broadcasting, reductions, cumulative operations, out-of-core linear algebra (matmul and tensordot), and persistent lazy expressions saved on disk.

  • Universal Compute Backend: Using blosc2.evaluate() and lazyexpr, the same out-of-core compute engine operates directly across NumPy, HDF5, Zarr, Xarray, and TileDB arrays—even mixing formats in a single expression—and can also serve as a JIT engine for pandas (engine=blosc2.jit).

Blosc2 vs others compute performance

Ecosystem Interoperability & Cloud Access

  • Array & Tabular Standards: Python-Blosc2 aligns closely with the Python Array API and implements the Arrow PyCapsule protocol, enabling DuckDB, Polars, pandas 3+, and PyArrow to stream data directly from compressed CTable files without conversion—and allowing zero-friction ingestion via CTable.from_arrow() and from_csv().

  • Unified Local & Remote Interface: blosc2.open() provides a single streaming and persistent local-caching (cache_dir) interface across local and remote Parquet, Zarr, HDF5, PyTables, and native Blosc2 datasets over HTTP, S3, or any fsspec filesystem. Queries fetch only the chunks or row groups they touch and automatically leverage persisted remote indexes without full downloads.

  • Cloud-Native Services: Blosc2 also supports accessing cloud data directly via C2Array, the Caterva2 library, or Cat2Cloud, enabling efficient remote analysis without downloading entire datasets locally.

Caterva2 screenshot
JupyterLite with Caterva2 and Blosc2

Open, Extensible, and Evolving

  • Open Format & Dynamic Plugins: Blosc2 is an open, fully documented format, ensuring you are never locked into a proprietary solution. You can register custom codecs and filters as dynamic plugins—such as the OpenZL codec plugin—while Btune uses machine learning to automatically select optimal compression parameters for your data.

  • Hardening C-Blosc2 (Sovereign Tech Agency Roadmap): Backed by a €286,000 award from the Sovereign Tech Agency, we are bringing Blosc2's advanced capabilities directly into the foundational C-Blosc2 library: formal open binary RFC specifications, native C containers (DictStore, EmbedStore, CTable), embedded zero-dependency miniexpr computation, intelligent slicing and chunk pruning, built-in data encryption, continuous OSS-Fuzz/security hardening, and open governance through the reactivated Blosc Steering Council—making the full Blosc2 stack natively accessible from C/C++, Rust, Julia, Go, and WebAssembly.

Main goals of the Blosc2 project for the Sovereign Tech Agency

For full technical plans, please refer to our C-Blosc2 ROADMAP.

Get Involved

The home for all Blosc-related libraries is on GitHub. You can download the source code, file tickets, ask questions, and contribute to the project there.

Stay informed about the latest developments by following us on our social networks:

Support Blosc for a Sustainable Future

Blosc is the result of countless hours of effort by dedicated developers and the generous backing of organizations like NumFOCUS, ironArray SLU, and the Sovereign Tech Agency. Financial contributions are critical for the long-term sustainability of open-source projects like Blosc.

Your support helps us continue development, maintenance, and innovation. Here are some ways you can contribute financially:

  1. NumFOCUS: Blosc is a fiscally sponsored project of NumFOCUS, a nonprofit supporting open-source scientific computing.
  2. ironArray: ironArray SLU drives Blosc2 development and offers commercial support and consulting services.
  3. GitHub Sponsorship: You can support us directly by clicking the "Sponsor" button on GitHub.

Thank you for helping us build a sustainable future for the Blosc ecosystem!

-- The Blosc Development Team