LibraryActive

ArduinoJson

ArduinoJson is a C++ JSON library for Arduino and embedded systems, enabling deserialization and serialization of JSON documents.

Open source page

Product features

Product features

API Reference

Detailed documentation of each function.

Written by the author

The book is written by Benoît Blanchon, the creator of ArduinoJson.

Compile Time Configuration

Settings to configure the library.

Comprehensive guide

Covers everything from basic usage to advanced techniques.

Documented feature

C++ refresher

Includes a quick C++ course for beginners.

Default Values with Pipe Operator

Set fallback values for missing or type-mismatched fields using the pipe operator.

Deserialization Tutorial

Step-by-step guide on how to parse a JSON document using the library.

deserializeJson()

Parse JSON input into a JsonDocument.

Error Handling

Check DeserializationError and handle extraction errors with default values.

Examples

Complete programs showing usage in various situations.

Extract Values

Access members and array elements with square brackets and implicit type conversion.

FAQ

Answers to frequent questions.

How To's

Recipes and techniques to use ArduinoJson in your project.

JSON HTTP Client

Parse JSON in an HTTP response using Ethernet library.

JSON HTTP Server

Implement an HTTP server that sends JSON in responses.

JsonArray

A reference to a JSON array in a JsonDocument.

JsonDocument

Owns the memory for JsonArray, JsonObject and JsonVariant.

JSON Generator

Example showing how to generate a JSON document.

JsonObject

A reference to a JSON object in a JsonDocument.

JSON Parser

Example showing how to deserialize a JSON document.

JsonVariant

A reference to a JSON value (array, object, integer…) in a JsonDocument.

Reference Types

Use JsonArray, JsonObject, and JsonVariant to reference values in the document.

Release Notes

Changes between versions.

Safer Copy Policies

Stores const char* by copy but string literals by reference.

Sample projects

Provides sample projects to illustrate best practices.

Serialization Tutorial

Step-by-step guide on how to generate a JSON document using the library.

serializeJson()

Produces minified JSON output.

serializeJsonPretty()

Produces indented JSON output.

Smaller Arrays

Cuts array size in half on 32-bit platforms.

String Deduplication

Deduplicates identical strings to save memory.

Tiny String Optimization

Optimizes memory for strings of three characters or less.

Tutorials

Step-by-step guides for deserialization and serialization.

JSON UDP Beacon

Send JSON to a UDP socket.