# nlohmann/json

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nlohmann-json).**

48,929 stars · 7,310 forks · C++ · mit

## Links

- GitHub: https://github.com/nlohmann/json
- Homepage: https://json.nlohmann.me
- awesome-repositories: https://awesome-repositories.com/repository/nlohmann-json.md

## Topics

`bson` `cbor` `header-only` `json` `json-diff` `json-merge-patch` `json-parser` `json-patch` `json-pointer` `json-serialization` `messagepack` `msgpack` `rfc-6901` `rfc-6902` `rfc-7049` `rfc-7159` `rfc-8259` `stl-containers` `ubjson`

## Description

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 representations to optimize storage and transmission. Additionally, the library implements an event-driven parsing model to minimize memory usage during large document traversal and provides native-like integration by mimicking standard container interfaces and iterator patterns.

Beyond its core serialization and parsing capabilities, the library includes comprehensive tools for document patching, merging, and granular data modification. It supports flexible configuration for handling non-standard syntax, character encodings, and key order preservation, ensuring compatibility with diverse data requirements.

The library is distributed as a single-header file, facilitating integration into existing projects through source embedding or standard package management systems.

## Tags

### Data & Databases

- [Data Serialization and Parsing](https://awesome-repositories.com/f/data-databases/data-serialization-and-parsing.md) — Reads and writes data from various sources while providing control over validation and output formatting. ([source](https://json.nlohmann.me/api/basic_json/))
- [JSON Processors](https://awesome-repositories.com/f/data-databases/json-processors.md) — Implements a specialized engine for navigating and modifying hierarchical JSON structures using pointer paths.
- [Serialization Libraries](https://awesome-repositories.com/f/data-databases/serialization-libraries.md) — Converts complex application objects into structured text formats for storage or network transmission.
- [Recursive Data Models](https://awesome-repositories.com/f/data-databases/recursive-data-models.md) — Represents arbitrary JSON structures using a single recursive variant type.
- [Binary Data Formats](https://awesome-repositories.com/f/data-databases/binary-data-formats.md) — Provides a unified interface for encoding and decoding data into multiple compact binary representations. ([source](https://json.nlohmann.me/api/basic_json/))
- [Serialization Frameworks](https://awesome-repositories.com/f/data-databases/serialization-frameworks.md) — Provides a robust framework for serializing complex objects into multiple formats with strict schema validation.
- [Binary Serialization](https://awesome-repositories.com/f/data-databases/binary-serialization.md) — Transforms structured information into compact binary representations to optimize storage space.
- [Streaming Parsers](https://awesome-repositories.com/f/data-databases/streaming-parsers.md) — Processes input streams by triggering callbacks for each structural element to minimize memory usage.
- [Custom Type Converters](https://awesome-repositories.com/f/data-databases/custom-type-converters.md) — Defines conversion functions to map user-defined structures to data formats. ([source](https://cdn.jsdelivr.net/gh/nlohmann/json@develop/README.md))
- [Data Lookup Interfaces](https://awesome-repositories.com/f/data-databases/data-lookup-interfaces.md) — Accesses specific data points within structured data using direct key lookups or collection-based indexing. ([source](https://json.nlohmann.me/api/basic_json/))
- [JSON Patching](https://awesome-repositories.com/f/data-databases/json-patching.md) — Updates objects by applying standard merge patches to integrate new values into existing structures. ([source](https://json.nlohmann.me/api/basic_json/))
- [Serialization Policies](https://awesome-repositories.com/f/data-databases/serialization-policies.md) — Employs template specialization to map custom user-defined types directly into the library data model.
- [Type Mapping Frameworks](https://awesome-repositories.com/f/data-databases/type-mapping-frameworks.md) — Defines automated conversion rules to map user-defined application structures directly into standardized data formats.
- [Data Modification APIs](https://awesome-repositories.com/f/data-databases/data-modification-apis.md) — Updates data by adding, inserting, or removing elements, and manages object lifecycles. ([source](https://json.nlohmann.me/api/basic_json/))
- [Document Patching](https://awesome-repositories.com/f/data-databases/document-patching.md) — Provides mechanisms to calculate differences and apply granular updates to structured documents.
- [Document Patching Utilities](https://awesome-repositories.com/f/data-databases/document-patching-utilities.md) — Implements standard document modification protocols by traversing nested structures using path-based identifiers.
- [Type Extraction Utilities](https://awesome-repositories.com/f/data-databases/type-extraction-utilities.md) — Converts stored data into native types or writes values directly into destination variables. ([source](https://json.nlohmann.me/api/basic_json/))

### Programming Languages & Runtimes

- [Header-Only Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/header-only-libraries.md) — Ships as a header-only library for intuitive parsing and manipulation of structured data in C++.
- [Template Metaprogramming Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/template-metaprogramming-libraries.md) — Uses C++ templates to generate type-safe data structures at compile time.
- [Standard Library Adapters](https://awesome-repositories.com/f/programming-languages-runtimes/standard-library-adapters.md) — Exposes data structures through standard iterator patterns and container aliases.
