For a C++ library for data serialization, the strongest matches are uscilab/cereal (Cereal is a header-only C++ library that provides comprehensive), google/protobuf (Protocol Buffers is a industry-standard serialization framework that provides) and google/flatbuffers (FlatBuffers is a high-performance C++ serialization library that provides). protocolbuffers/protobuf and capnproto/capnproto round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best c++ serialization libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
Cereal is a C++ serialization library and object persistence tool used to convert data types and containers into formats for storage or transmission. It is implemented as a header-only library, allowing it to be included directly in source code without the need for a compiled binary. The library supports multiple data representations, including binary, XML, and JSON. It provides the ability to define custom archives, enabling the development of specialized output formats to control how data is encoded and stored. The system handles the conversion of complex objects through template-based ser
Cereal is a header-only C++ library that provides comprehensive support for binary, JSON, and XML serialization, making it a flagship tool for high-performance data persistence and transmission.
Protocol Buffers is a binary serialization framework used to encode structured information into compact payloads to reduce network bandwidth and storage. It functions as a cross-language data interchange standard that enables different platforms and languages to exchange structured data using a shared schema. The project includes an interface definition language compiler that transforms schema definitions into type-safe source code for multiple target programming languages. This mechanism decouples data structures from specific language memory layouts and ensures consistent data handling acro
Protocol Buffers is a industry-standard serialization framework that provides high-performance binary encoding and schema evolution, though it relies on a separate IDL compiler rather than pure compile-time C++ reflection.
FlatBuffers is a cross-platform serialization library designed for performance-critical applications that require efficient, zero-copy data access. By organizing data in a structured binary format, it allows applications to read and write complex data structures directly from memory-mapped buffers without the need for intermediate parsing or temporary object allocation. The project distinguishes itself through a schema-driven approach that balances high-performance access with long-term data evolution. It utilizes a unique memory layout featuring relative offsets and inline fixed-size structu
FlatBuffers is a high-performance C++ serialization library that provides zero-copy deserialization and schema evolution, making it a flagship tool for efficient data access in performance-critical applications.
Protocol Buffers is a language-neutral, platform-agnostic mechanism for serializing structured data. It provides a schema-driven toolchain that compiles declarative data definitions into type-safe source code, enabling consistent communication and strongly typed API contracts across services written in different programming languages. The project distinguishes itself through a highly efficient binary wire format that utilizes tag-based encoding and variable-width integer compression to minimize payload size and processing overhead. It supports robust evolutionary schema management, allowing d
Protocol Buffers is a industry-standard serialization framework that provides high-performance binary encoding, schema evolution, and robust support for both binary and JSON formats, making it a comprehensive solution for structured data serialization in C++.
CapnProto is a zero-copy serialization framework and remote procedure call system. It serves as a C++ communication library providing a schema-based data interchange format that eliminates the need to encode or decode data before reading it from memory. The system enables high-performance data serialization and low-latency network communication. It supports cross-language data exchange by using a defined schema to ensure consistent binary representation across different platforms. The framework provides tools for implementing remote procedure calls, allowing functions to be invoked on a remo
Cap'n Proto is a high-performance serialization framework that excels at zero-copy deserialization and schema-based binary data exchange, though it focuses on its own efficient binary format rather than providing native JSON or text support.
JsonCpp is a C++ library for parsing, manipulating, and generating JSON data. It functions as a data interchange tool that provides a JSON parser to convert formatted text into structured data and a JSON serializer to transform internal data structures back into valid JSON strings. The library features the ability to preserve non-standard JSON comments during the deserialization and serialization process, which supports the management of human-readable configuration files. The project implements a tree-based internal representation for programmatic data access and uses a builder-based config
JsonCpp is a C++ library specifically designed for parsing and serializing JSON data, making it a valid tool for data interchange despite lacking support for binary formats or schema evolution.
RapidJSON is a header-only C++ library designed for high-performance parsing, generation, and manipulation of JSON data. It functions as a dual-mode engine, providing both an in-memory document object model for tree-based manipulation and a stream-based interface for event-driven processing. The library is built to minimize memory footprint and maximize execution speed, making it suitable for resource-constrained environments. The library distinguishes itself through advanced memory management and optimization techniques, including in-situ parsing that modifies input buffers directly to elimi
RapidJSON is a high-performance, header-only C++ library specifically designed for JSON serialization and deserialization, though it lacks support for binary formats and schema evolution.
This library is a header-only C++ framework designed for the serialization, parsing, and manipulation of structured data. It provides a recursive variant data model that represents arbitrary structures as native types, allowing developers to navigate, modify, and patch hierarchical data using standard pointer paths and declarative update patterns. The project distinguishes itself through its template-based architecture, which enables type-safe data structures and custom type mapping at compile time. It offers a unified interface for binary format abstraction, supporting multiple compact repre
This library is a widely-used, header-only C++ tool that provides robust support for JSON and several binary formats like MessagePack and CBOR, making it a strong choice for serialization tasks despite its primary focus on JSON-like data models.
simdjson is a high-performance, header-only C++ library designed for parsing, querying, and serializing JSON data with minimal memory overhead. It functions as a hardware-aware data processing engine that leverages vector instructions to achieve gigabyte-per-second parsing speeds. By detecting host processor capabilities at runtime, the library automatically selects the most efficient instruction sets to accelerate structural analysis and validation. The library distinguishes itself through a focus on extreme efficiency and resource management. It utilizes memory mapping and padded buffer ali
This library provides high-performance JSON parsing and construction capabilities using SIMD acceleration, making it a specialized tool for JSON serialization and deserialization despite its primary focus on extreme-speed parsing.
yaml-cpp is a C++ library for parsing and emitting YAML 1.2 documents. It provides a complete YAML processing pipeline, from reading YAML content into a traversable node tree to writing in-memory data structures back as YAML text. The library represents parsed YAML as a mutable tree of typed nodes, supporting scalars, sequences, maps, and aliases. It uses a recursive-descent parser to build this node tree, and a stream-based emitter to generate YAML output incrementally. Template-based type conversion enables compile-time serialization between YAML nodes and C++ types, including support for c
This library provides robust tools for serializing and deserializing C++ data structures specifically to and from the YAML format, serving as a specialized implementation within the broader serialization category.
MessagePack implementation for C and C++ / msgpack.orgC/C++
This library provides a high-performance binary serialization format for C and C++ that is widely used for efficient data transmission, though it focuses primarily on binary rather than providing built-in JSON or text support.
Boost.org serialization module
This library provides a robust, long-standing framework for serializing complex C++ data structures to multiple formats, though it is a comprehensive toolkit rather than a header-only implementation.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| uscilab/cereal | 4.7K | C++ | BSD-3-Clause | |
| google/protobuf | 71.4K | C++ | NOASSERTION | |
| google/flatbuffers | 25.6K | C++ | apache-2.0 | |
| protocolbuffers/protobuf | 71.4K | C++ | NOASSERTION | |
| capnproto/capnproto | 13.1K | C++ | NOASSERTION | |
| open-source-parsers/jsoncpp | 8.9K | C++ | NOASSERTION | |
| tencent/rapidjson | 15K | C++ | other | |
| nlohmann/json | 49.9K | C++ | MIT | |
| simdjson/simdjson | 23.3K | C++ | apache-2.0 | |
| jbeder/yaml-cpp | 5.9K | C++ | MIT |