# c-blosc: blocking compression built for cache-resident data

> C-Blosc is a meta-compressor that splits binary data into cache-sized blocks, shuffles them, and hands each block to a codec such as LZ4 or Zstd across threads. It is in pure maintenance mode, with the project pointing new users to C-Blosc2, so it suits codebases already committed to it rather than new deployments.

**Blosc/c-blosc** — A blocking, shuffling and loss-less compression library that can be faster than `memcpy()`.

- Repository: https://github.com/Blosc/c-blosc
- Website: https://www.blosc.org
- Stars: 1,060 · Forks: 173
- Language: C
- License: NOASSERTION
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/blosc-c-blosc

## A compressor designed around the cache, not around the file

C-Blosc is a high performance compressor for binary data, and the design goal is unusual: it is meant to transmit data to the processor cache faster than the traditional uncompressed direct memory fetch through a memcpy() OS call. The stated intent is to reduce the size of large datasets on disk or in memory and, at the same time, to accelerate memory-bound computations. The mechanism that gets it there is the blocking technique, which divides datasets into blocks small enough to fit in the caches of modern processors and performs compression or decompression there. The point is to reduce activity on the memory bus, not merely to reduce bytes. A file that compresses well but has to be reconstructed in large chunks through main memory can still be slower to work with than an uncompressed one that stays resident, and blocking is what makes the difference. The library targets all platforms with a C89 compliant compiler, with Intel platforms on Linux, Mac OSX and Windows and ARM on Linux being the mostly tested ones.

## A meta-compressor coordinating several codecs and filters

The framing is what makes C-Blosc different from a codec. It is not a compressor but a meta-compressor, because it can use different compressors and filters, where filters are programs that generally improve the compression ratio. It also behaves like a regular codec because it ships with several compressors and filters already inside it. The bundled codecs are BloscLZ, which is heavily based on FastLZ, LZ4 and LZ4HC, Snappy, Zlib and Zstandard. The filters are the shuffle and bitshuffle filters, both highly optimized and able to use SSE2 or AVX2 instructions when they are available. Blosc is the layer in charge of coordinating compressors and filters so that the blocking technique and multi-threaded execution apply automatically, which is the point: a codec that was not designed for blocking or threading still ends up working at high speed because Blosc arranges the work. For binary data there is an extra lever, because the type size meta-information can be used to improve the compression ratio through the integrated shuffle and bitshuffle filters.

## An out-of-source CMake build with codec switches

The build is CMake and the documented procedure is out of source. The first three commands create and enter a build directory:

```console
$ cd c-blosc
$ mkdir build
$ cd build
```

Then configure, optionally naming the installation directory:

```console
$ cmake -DCMAKE_INSTALL_PREFIX=your_install_prefix_directory ..
```

Build, test and install:

```console
$ cmake --build .
$ ctest
$ cmake --build . --target install
```

The static and dynamic versions of the library, together with the header files, land in the prefix you set. Configuration can also be driven through the CMake user interfaces, ccmake for a curses interface or cmake-gui for a graphical one, and CMake can be told to prefer internal or external compressor sources and to enable or disable individual codecs. On macOS, compilation trouble is usually the missing command line developer tools, which you install with `xcode-select --install`. The examples directory in the repository holds several starting points, including simple.c, noinit.c, many_compressors.c, multithread.c and win-dynamic-linking.c.

## Bundled codec sources mean you rarely need system libraries

The packaging decision worth understanding is that C-Blosc comes with the full sources for LZ4, LZ4HC, Snappy, Zlib and Zstd, and by default the included sources are compiled into the C-Blosc library. The documented consequence is that you should not worry about a missing system library, because the build has complete support for all the codecs in all Blosc deployments unless you explicitly exclude some. That is a real advantage for a library that gets linked into a Python wheel, a conda package, or a binary distribution where the system copy of zlib may differ from what you tested against. If you do want the external libraries, the switch is one flag:

```console
$ cmake -DPREFER_EXTERNAL_ZSTD=ON ..
```

And to drop support for a codec, for instance when you have no C++ compiler for Snappy:

```console
$ cmake -DDEACTIVATE_SNAPPY=ON ..  # in case you don't have a C++ compiler
```

Those two options are the whole of the codec configuration surface exposed in the documentation, which keeps the build reproducible across platforms.

## Pure maintenance mode, and the successor the project points at

The most consequential line in the documentation is a note at the top: this package is in pure maintenance mode and will not acquire new features in the future, and there is a more modern version called C-Blosc2 which supports many more features and is more actively maintained. That changes how you should read everything else here. The published releases are v1.21.6 on 2024-08-17, v1.21.5 on 2023-09-02 and v1.21.4 on 2023-05-16, and the last push was on 2026-08-27, so maintenance continues but the feature line is closed. For a project evaluating a compression library today, C-Blosc2 is the answer, not this one. C-Blosc remains the right choice for code that already links it, that already stores data in its chunk format, or that needs a specific behaviour this version has and the newer one has not yet matched. The repository root makes that split visible in the file list, with README_CHUNK_FORMAT.rst, README_THREADED.rst, COMPILING_WITH_WHEELS.rst, an ANNOUNCE.rst and a RELEASE_NOTES.rst alongside the usual sources, benchmarks, tests and internal-complibs directories.

## Where a meta-compressor is the wrong tool

Blosc is built for binary data and for the memory-bound case, and that focus limits where it wins. Text and other high-entropy payloads do not benefit much from the shuffle and bitshuffle filters, so the meta-compressor machinery buys little and you are left with the underlying codec's ratio. The design also assumes you have a cache to be fast against, which is exactly the assumption that does not hold on a device or a machine where the working set does not fit, so the performance argument inverts there. The blocking technique also changes the shape of the data you store, so the chunk format is a commitment rather than a detail, and a system that needs to read blocks with a different tool later needs that tool to understand the format. Finally, the codec set is fixed at what the project ships, so if you need a codec that is not in the list, this library is not a framework for adding one.

## Interfaces around the library: Python, Bloscpack and HDF5

C-Blosc is a C library, but most use is through one of the surrounding projects. There is an official Python wrapper, python-blosc, and there is Bloscpack, which is the command line interface and the serialization format for Blosc data. There is also a sample implementation of Blosc as a filter for the HDF5 library, for those who want the compression applied inside an HDF5 dataset rather than as a separate step. So the practical question of how you get data in and out of the format is answered by other repositories, and this one supplies the core. The Python wrapper is the route most people take when the data lives in a NumPy array, and Bloscpack is the route for command line work and for files that need to be read outside a Python process. The thread behaviour, which is the part of the design that makes the library fast, is documented separately in README_THREADED.rst, and the format itself in README_CHUNK_FORMAT.rst.

## Conclusion

Adopt c-blosc only for code that already depends on it, or where its chunk format is already written into stored data, because the project is in pure maintenance mode and will not gain new features. For anything new, use C-Blosc2, which the project names as the more modern and actively maintained version. Before staying on c-blosc, check the codec support in your build, since CMake compiles the bundled LZ4, LZ4HC, Snappy, Zlib and Zstd sources by default and you only need external libraries if you pass PREFER_EXTERNAL_ZSTD, and read LICENSE.txt rather than relying on the BSD line, because the repository's licence field is classified as a custom licence.

## FAQ

### What is the difference between C-Blosc and C-Blosc2?

C-Blosc is in pure maintenance mode and will not acquire new features. The project points to C-Blosc2 as the more modern version that supports many more features and is more actively maintained.

### How do I build and install c-blosc?

Use an out-of-source CMake build: create and enter a build directory, run `cmake -DCMAKE_INSTALL_PREFIX=your_install_prefix_directory ..`, then `cmake --build .`, `ctest`, and `cmake --build . --target install`.

### Which compression codecs does c-blosc support?

BloscLZ, which is heavily based on FastLZ, plus LZ4, LZ4HC, Snappy, Zlib and Zstandard. The sources for LZ4, LZ4HC, Snappy, Zlib and Zstd are bundled and compiled in by default.

### What is the blocking technique in Blosc?

It divides datasets into blocks small enough to fit in the caches of modern processors and performs compression or decompression there, which reduces activity on the memory bus. Blosc also uses SIMD instructions such as SSE2 and AVX2 when available, and coordinates multi-threaded execution.

### How do I use the system Zstd library instead of the bundled one?

Configure with `cmake -DPREFER_EXTERNAL_ZSTD=ON ..`. To drop a codec instead, for example when you have no C++ compiler for Snappy, use `cmake -DDEACTIVATE_SNAPPY=ON ..`.

## Sources

- [Blosc/c-blosc on GitHub](https://github.com/Blosc/c-blosc)
- [Issues](https://github.com/Blosc/c-blosc/issues)
- [Project website](https://www.blosc.org)
- [README](https://github.com/Blosc/c-blosc/blob/main/README.md)
- [Releases](https://github.com/Blosc/c-blosc/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/blosc-c-blosc
