Parse JSON configuration files in C++ applications without external dependencies.
Call REST APIs and deserialize JSON responses into C++ objects.
Serialize C++ data structures to JSON for inter-process communication or storage.
Convert between JSON and standard C++ containers like vectors and maps.
nlohmann/json is a C++ library that makes working with JSON data feel natural and straightforward. JSON, which stands for JavaScript Object Notation, is a widely used format for storing and exchanging data between programs and APIs, but C++ does not have built-in JSON support the way languages like Python or JavaScript do. This library bridges that gap by providing a json type that you can use in C++ code almost like a native data structure. The library's key design goal is making integration trivially easy. The entire implementation lives in a single header file, json.hpp, which means you just copy or include one file in your project with no separate compilation step, no linking against an external library, and no changes to your build configuration. Once included, you can parse JSON from a string or file, access nested values using bracket notation, create JSON structures by assigning C++ values, and convert between JSON and standard C++ containers like std::vector and std::map. It also supports advanced features like JSON Pointer for addressing nested elements, JSON Patch for describing changes to a JSON document, and several binary serialization formats like CBOR and MessagePack as alternatives to plain text JSON. You would use this library when you are writing a C++ program that needs to read a configuration file, call a web API, parse data from a service, or exchange structured data with another system that uses JSON. It is aimed at developers who want clean, readable code over maximum raw parsing speed. The library requires a C++11-capable compiler and is widely available through package managers like Conan, vcpkg, and most Linux distribution repositories. The tech stack is pure modern C++.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.