What JSON library do you suggest?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/cpp

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
  • RapidJSON

    A fast JSON parser/generator for C++ with both SAX/DOM style API

    Thank you for your response. In reply to the first issue you raise, note that Tencent gives the following guidance: "Generally speaking, RapidJSON should be exception-safe (enough) to replace RAPIDJSON_ASSERT by an exception." If some of those functions are now noexcept, that would be... unfortunate. Especially if this is the kind of noexcept that gets randomly slapped on functions nowadays "because we can", rather than "because we must".

  • json

    JSON for Modern C++

    https://github.com/nlohmann/json for ease of use; I'd suggest this as your general go to, and switch libraries if extreme performance is needed, and reading large amounts of JSON is part of the bottleneck. In which case https://github.com/simdjson/simdjson

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • simdjson

    Parsing gigabytes of JSON per second

    https://github.com/nlohmann/json for ease of use; I'd suggest this as your general go to, and switch libraries if extreme performance is needed, and reading large amounts of JSON is part of the bottleneck. In which case https://github.com/simdjson/simdjson

  • JsonCpp

    A C++ library for interacting with JSON.

    I like https://github.com/open-source-parsers/jsoncpp

  • json_struct

    json_struct is a single header only C++ library for parsing JSON directly to C++ structs and vice versa

    json_struct for serializing directly to and from structs. Its one header only and performs on par with RapidJSON.

  • univalue

    An easy-to-use and competitively fast JSON parsing library for C++17, forked from Bitcoin Cash Node's own UniValue library.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • json_dto

    A small header-only library for converting data between json representation and c++ structs

    json_dto on top of RapidJSON.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts