Stage 01 · Write · Researched comparison
Best C++ JSON Libraries in 2026
nlohmann/json is the first pick for most teams because it offers a clean, header-only API with STL-like containers and is easy to read and maintain. RapidJSON suits projects that need a small, fast DOM or SAX parser with fine control over memory. simdjson is the better fit when parsing speed on large documents is the main requirement and you can accept a stricter API.
By Shihab Mia
Published 27 Nov 2026 · 7 tools compared
We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
- nlohmann/json, RapidJSON, simdjson, Boost.JSON, Glaze, jsoncpp and yyjson are all free and open source, so cost is not the deciding factor.
- simdjson and yyjson target high parse throughput, while nlohmann/json and Boost.JSON favor a simpler, more familiar API.
- Glaze and Boost.JSON lean on modern C++ features, so check your compiler and standard version before adopting them.
- These are code libraries, not web pages, so your JSON stays in your own build and runtime rather than a third-party site.
Who each pick is for
- General-purpose parsing with an easy, STL-like APInlohmann/json
- Fast DOM and SAX parsing with tight memory controlRapidJSON
- High-throughput parsing of large JSON documentssimdjson
- Projects already using Boost that want a modern JSON APIBoost.JSON
- Reflection-based serialization with strong compile-time checksGlaze
- Legacy codebases that need a stable, long-standing parserjsoncpp
- Very fast parsing from C and C++ codeyyjson
Comparison
| Tool | Best for | Standout feature | Listed starting price | Free plan or trial |
|---|---|---|---|---|
| 1nlohmann/json | General-purpose parsing with an easy, STL-like API | Header-only and simple to integrate | Free (open source) | Free plan |
| 2RapidJSON | Fast DOM and SAX parsing with tight memory control | Small header-only footprint | Free (open source) | Free plan |
| 3simdjson | High-throughput parsing of large JSON documents | Uses SIMD instructions for fast parsing | Free (open source) | Free plan |
| 4Boost.JSON | Projects already using Boost that want a modern JSON API | Clean API with value, array and object types | Free (open source) | Free plan |
| 5Glaze | Reflection-based serialization with strong compile-time checks | Maps JSON directly to structs with little boilerplate | Free (open source) | Free plan |
| 6jsoncpp | Legacy codebases that need a stable, long-standing parser | Long history and wide use | Free (open source) | Free plan |
| 7yyjson | Very fast parsing from C and C++ code | High performance with a small C core | Free (open source) | Free plan |
How we picked
We compared these libraries on fit for common C++ JSON tasks, supported platforms and compilers, licence terms, API style, and known limits such as hardware requirements or dependency weight. Sources are vendor documentation, project repositories and public licence files. We did not run benchmarks or hands-on tests. Prices and licences can change, so confirm details on each project's page before you commit.
The tools, one by one
nlohmann/json
Best for general-purpose parsing with an easy, STL-like API

What it is and where it fits
nlohmann/json is a header-only library that models JSON values with types similar to standard containers. You read and write JSON with operators and iterators that most C++ developers already know, which keeps calling code short and readable. It supports parsing, serialization, and conversion to and from user-defined types.
It works with any conforming C++11 compiler and needs no build step beyond including the header. The licence is MIT. The trade-off is performance: it allocates and copies more than specialized parsers, and including the single header in many translation units can increase build time. Teams that parse very large documents in hot paths often look elsewhere. It is a good default for configuration files, APIs and tools where clarity matters more than raw speed.
Standout: Header-only and simple to integrate
Free (open source), as listed by the vendor (nlohmann/json website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Header-only and simple to integrate
- familiar container and iterator interface
Drawbacks
- Slower and heavier than SIMD-focused parsers
- single header can slow compile times
Skip it if this limit matters to you: slower and heavier than SIMD-focused parsers.
Verdict. A sensible pick for general-purpose parsing with an easy, STL-like API.
Alternatives in this guide: RapidJSON, simdjson, Boost.JSON
RapidJSON
Best for fast DOM and SAX parsing with tight memory control

What it is and where it fits
RapidJSON is a header-only C++ library from Tencent with both DOM and SAX interfaces. It is designed for speed and low memory use, and it offers in-situ parsing, which modifies the input buffer to avoid extra allocations. You can supply your own allocator, which helps in constrained environments.
It targets C++03 and later and is released under the MIT licence. The API is more explicit than nlohmann/json: you manage documents, values and allocators, and error handling is done through return values rather than exceptions by default. That control is useful for embedded and performance-sensitive code but adds boilerplate. Newer projects sometimes prefer a simpler API unless they specifically need RapidJSON's memory behavior.
Standout: Small header-only footprint
Free (open source), as listed by the vendor (RapidJSON website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Small header-only footprint
- in-situ parsing and explicit allocator control
Drawbacks
- API is more verbose
- manual memory handling takes care
Skip it if this limit matters to you: API is more verbose.
Verdict. A sensible pick for fast DOM and SAX parsing with tight memory control.
Alternatives in this guide: nlohmann/json, simdjson, Boost.JSON
simdjson
Best for high-throughput parsing of large JSON documents

What it is and where it fits
simdjson parses JSON using SIMD instructions available on modern x64 and ARM64 processors. It is built for workloads where documents are large and parsing speed matters, such as log processing and data pipelines. It offers both a DOM-style API and an on-demand API that parses only the fields you access.
It needs a 64-bit platform and a compiler that supports the required instruction sets, and it falls back or errors on unsupported hardware. The licence is Apache 2.0. The API is less forgiving than nlohmann/json and expects well-formed input with strict validation. If you need to parse small documents occasionally, the setup and hardware requirements may not be worth it.
Standout: Uses SIMD instructions for fast parsing
Free (open source), as listed by the vendor (simdjson website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Uses SIMD instructions for fast parsing
- validates UTF-8 and structure strictly
Drawbacks
- Requires a recent 64-bit CPU and compiler
- API differs from DOM-style libraries
Skip it if this limit matters to you: requires a recent 64-bit CPU and compiler.
Verdict. A sensible pick for high-throughput parsing of large JSON documents.
Alternatives in this guide: nlohmann/json, RapidJSON, Boost.JSON
Boost.JSON
Best for projects already using Boost that want a modern JSON API

What it is and where it fits
Boost.JSON is part of the Boost libraries and provides a JSON value type, parser and serializer. It stores parsed data in contiguous memory and offers both a DOM API and a streaming parser. It integrates with the rest of Boost, which helps if your project already depends on it.
It is distributed under the Boost Software License and follows Boost's release schedule. The library needs a C++11-capable compiler, and using it means adopting the Boost build and dependency setup. For teams outside Boost, adding the dependency just for JSON may be more than needed. For teams already inside Boost, it is a natural choice with a clear, modern interface.
Standout: Clean API with value, array and object types
Free (open source), as listed by the vendor (Boost.JSON website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Clean API with value, array and object types
- fits the Boost release cycle
Drawbacks
- Pulls in Boost as a dependency
- requires a reasonably modern compiler
Skip it if this limit matters to you: pulls in Boost as a dependency.
Verdict. A sensible pick for projects already using Boost that want a modern JSON API.
Alternatives in this guide: nlohmann/json, RapidJSON, simdjson
Glaze
Best for reflection-based serialization with strong compile-time checks

What it is and where it fits
Glaze is a header-only C++ library focused on direct serialization between JSON and C++ structs. It uses compile-time reflection so you can read and write structs without writing field-by-field code. It also supports JSON, BEVE and other formats, and it emphasizes performance.
It requires a modern compiler and a recent C++ standard, so older toolchains will not work. The licence is MIT. Because it leans on newer language features, error messages can be long and the learning curve is steeper for teams on older codebases. It suits projects that want minimal mapping code and can adopt a current compiler.
Standout: Maps JSON directly to structs with little boilerplate
Free (open source), as listed by the vendor (Glaze website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Maps JSON directly to structs with little boilerplate
- fast compile-time reflection
Drawbacks
- Requires a recent C++ standard
- smaller ecosystem than older libraries
Skip it if this limit matters to you: requires a recent C++ standard.
Verdict. A sensible pick for reflection-based serialization with strong compile-time checks.
Alternatives in this guide: nlohmann/json, RapidJSON, simdjson
jsoncpp
Best for legacy codebases that need a stable, long-standing parser

What it is and where it fits
jsoncpp is one of the older C++ JSON libraries still in use. It provides a value type, a reader and a writer, and it handles parsing and serialization with a straightforward API. Many existing projects depend on it, so it remains a common choice for maintenance work.
It is released under the MIT licence and builds with a range of compilers. Its design predates modern C++ JSON libraries, so performance and API ergonomics trail newer options like simdjson and Glaze. Development is slower than it once was. New projects usually pick a more modern library, but jsoncpp is reasonable when you are maintaining code that already uses it.
Standout: Long history and wide use
Free (open source), as listed by the vendor (jsoncpp website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- Long history and wide use
- straightforward value-based API
Drawbacks
- Older design with slower performance
- less active development than newer options
Skip it if this limit matters to you: older design with slower performance.
Verdict. A sensible pick for legacy codebases that need a stable, long-standing parser.
Alternatives in this guide: nlohmann/json, RapidJSON, simdjson
yyjson
Best for very fast parsing from C and C++ code

What it is and where it fits
yyjson is a JSON library written in C that compiles cleanly as C++ and can be called from C++ projects. It focuses on speed and a small footprint, with a DOM API and options for reading and writing. It supports both mutable and immutable documents.
It is MIT licensed and has no dependencies beyond the standard C library. Because the API is C-style, C++ developers work with pointers and manual lifetime handling rather than RAII containers. That is fine for performance-critical code but less convenient for general application logic. It is a good fit when you want a fast C core and are comfortable with a C interface.
Standout: High performance with a small C core
Free (open source), as listed by the vendor (yyjson website). Confirm the current plan price before you buy.
Free plan. Plans change, so confirm on the vendor's pricing page before you buy.
Benefits
- High performance with a small C core
- usable from C++ without wrappers
Drawbacks
- C-style API is less idiomatic in C++
- fewer C++ conveniences
Skip it if this limit matters to you: C-style API is less idiomatic in C++.
Verdict. A sensible pick for very fast parsing from C and C++ code.
Alternatives in this guide: nlohmann/json, RapidJSON, simdjson
Who should use what
If you want readable code and fast onboarding, start with nlohmann/json. If you parse large documents in a pipeline and control the hardware, simdjson is the speed-focused choice. If your project already depends on Boost, Boost.JSON avoids adding another dependency. If you maintain older code that already uses jsoncpp, keep it rather than rewriting for its own sake. Teams that want struct mapping with little boilerplate should look at Glaze on a modern compiler.
Questions to settle before you buy
What to check before you buy
- Confirm the library supports your compiler version and C++ standard.
- Check the licence terms against your distribution and linking model.
- Decide whether you need DOM, SAX or on-demand parsing for your workload.
- Test with your real document sizes, including malformed input and deep nesting.
- Verify hardware requirements if you consider SIMD-based parsers.
FAQ
Is nlohmann/json fast enough for production?
For many applications, yes. It is slower than simdjson and yyjson on large documents, but it is fine for configuration, APIs and moderate payloads. Measure with your own data before deciding.
Do these libraries send my JSON anywhere?
No. They are code libraries that run in your own process. Your data stays on your machine or server, unlike third-party web formatters where you should avoid pasting secrets.
Can I use a C library like yyjson in a C++ project?
Yes. yyjson compiles as C++ and can be called directly. You work with a C-style API, so expect manual lifetime handling rather than RAII containers.
Which library handles the largest documents best?
simdjson and yyjson are designed for high throughput on large inputs. simdjson needs a recent 64-bit CPU. Test both with your document shapes before choosing.
Are any of these libraries paid?
No. All seven are free and open source under permissive licences such as MIT, Apache 2.0 or the Boost Software License. Check each licence for your use case.
Sources we checked
Method: how we score · editorial policy.
Change log. First published 27 Nov 2026.