Generated by GPT-5-mini| nlohmann/json | |
|---|---|
| Name | nlohmann/json |
| Author | Niels Lohmann |
| Programming language | C++ |
| License | MIT License |
| Repository | GitHub |
| First release | 2013 |
nlohmann/json is a single-header C++ library for working with JSON data that provides an STL-like interface and integrates with modern C++ features. It is designed to be easy to include in C++ projects, offering parsing, serialization, and manipulation of JSON values with strong typing, exceptions, and iterator support. The project has been used across software developed by organizations, research groups, and open-source ecosystems.
nlohmann/json is authored by Niels Lohmann and distributed under the MIT License, enabling use in projects by Microsoft Corporation, Google, Facebook, Amazon (company), Intel, Red Hat, Canonical (company), Mozilla Foundation, IBM, Siemens, NVIDIA, ARM Holdings, Ericsson, Sony Corporation, SAP SE, VMware, Oracle Corporation, HP Inc., LG Electronics, Bosch (company), Dell Technologies, Accenture, Atlassian, Sony Interactive Entertainment, Twitter, Uber Technologies, Airbnb, Stripe (company), Spotify, Snap Inc., Dropbox, Adobe Inc., Autodesk, Qualcomm, Broadcom Inc., Cisco Systems, Philips, Schneider Electric, Toshiba Corporation, Panasonic Corporation, Hitachi, Fujitsu, ZTE, Xiaomi, Lenovo, Roche, BASF SE, Bayer AG, GlaxoSmithKline, Johnson & Johnson, Pfizer, Novartis, Roche Holding AG, Sony Music Entertainment, Warner Music Group, Universal Music Group, The Walt Disney Company, Netflix, Walt Disney Studios, BBC, The New York Times, The Guardian, Bloomberg L.P., Reuters, Financial Times, Forbes.
The library exposes a JSON value type with APIs influenced by C++ Standard Library, Boost (software), STLport, GNU Compiler Collection, Clang (compiler), Microsoft Visual C++, Intel C++ Compiler, LLVM Project, C++11, C++14, C++17, C++20, ISO/IEC JTC1/SC22/WG21 standards, Doxygen, and GitHub-style contributions. It supports parsing and serialization, exceptions modeled after std::exception, iterators consistent with std::vector, conversion functions similar to std::stoi, and integration hooks used by Apache Software Foundation projects and Linux Foundation ecosystems. Type-safe accessors, implicit conversions, and JSON Pointer support reflect ideas from RFC 6901 and ECMA International discussions.
Typical usage places the single header into C++ projects alongside build systems like CMake, Make (software), Bazel (software), Meson (software), Ninja (build system), or integration with package managers such as vcpkg, Conan (package manager), Homebrew, Apt (software), RPM Package Manager, Spack (software), CPAN, and PyPI-adjacent tooling. Developers use nlohmann/json with frameworks and libraries including Qt, Boost (software), POCO (C++ Libraries), gRPC, ZeroC Ice, Protobuf, OpenCV, ROS (Robot Operating System), TensorFlow, PyTorch, Eigen (software), OpenSSL, Cairo (graphics), SDL (software), GTK, wxWidgets, JUCE (software), Unreal Engine, Unity (game engine), Qt Creator, Visual Studio Code, Xcode, and continuous integration systems like Jenkins, Travis CI, CircleCI, GitLab CI/CD, Azure DevOps.
Implementation choices reflect idioms from C++ Standard Library, Boost (software), and serialization approaches found in Google Protocol Buffers, MessagePack, and CBOR (Concise Binary Object Representation). The library uses templates, type traits inspired by typeid and std::enable_if, RAII patterns from Bjarne Stroustrup, and error handling modeled on Herb Sutter recommendations. Internally it employs container-like storage akin to std::map and std::vector and leverages move semantics standardized by ISO/IEC committees. Design discussions and contributions occur on GitHub, with issue tracking and pull requests collaborating with developers affiliated to Linux Foundation projects and academic contributors from institutions such as Massachusetts Institute of Technology, Stanford University, University of California, Berkeley, Carnegie Mellon University, ETH Zurich, Technical University of Munich, University of Cambridge, University of Oxford, École Polytechnique Fédérale de Lausanne, Princeton University, Harvard University, California Institute of Technology, University of Toronto, University of Washington, University of Illinois Urbana–Champaign, Tsinghua University, Peking University, Shanghai Jiao Tong University, National University of Singapore.
Benchmarks compare nlohmann/json with other JSON libraries like RapidJSON, JsonCpp, simdjson, Boost.PropertyTree, PicoJSON, jansson, yajl, ultrajson, Parson (library), cJSON, QJsonDocument and with binary formats such as Protocol Buffers, Thrift, Avro (data serialization system), and MessagePack. Performance varies by workload; CPU-bound parsing often favors simdjson or RapidJSON, while nlohmann/json emphasizes ergonomics and correctness, similar to choices in projects by Google, Facebook, and Mozilla Foundation.
The library is integrated into ecosystems and products maintained by organizations like GitHub, GitLab, Bitbucket, KDE, GNOME, Canonical (company), Debian, Ubuntu, Fedora Project, openSUSE, Arch Linux, and used in tooling from LLVM Project, GCC, Clang (compiler), Valgrind-related analysis, and embedded systems from ARM Holdings and Raspberry Pi Foundation. Third-party bindings and wrappers connect it to language ecosystems associated with Python (programming language), Rust (programming language), Java (programming language), Go (programming language), Node.js, Ruby (programming language), Perl, Haskell, C#, F#, Swift (programming language), and Kotlin.
Development began with contributions by Niels Lohmann, evolving through community contributions on GitHub and discussion in venues frequented by contributors from Stack Overflow, Reddit, Hacker News, ISO/IEC JTC1/SC22/WG21 mailing lists, and conference talks at CppCon, CppNow, Google I/O, AWS re:Invent, Linux Foundation events, FOSDEM, EuroBSDCon, Embedded World, ACM SIGPLAN, IEEE symposia, and university workshops. The project progressed through releases aligning with C++ standard milestones and corporate adopters including Microsoft Corporation and Google integrating it into tooling and examples. Ongoing maintenance is coordinated via pull requests, issues, and continuous integration provided by GitHub Actions, Travis CI, and AppVeyor.
Category: C++ libraries