Serialize and Deserialize

ArduinoJson supports both JSON serialization and deserialization.

Read JSON:

JsonObject& root = jsonBuffer.parseObject(myInput);


root["last_modification"] = time();

…write back:



In addition to JSON, ArduinoJson 6 (currently in beta) also supports MessagePack, an alternative serialization format.

MessagePack is like a binary version of JSON. With ArduinoJson 6, you can switch from one format to the other with a single function call!

Fixed Memory Allocation

ArduinoJson uses a fixed memory allocation, allowing to work on devices with very little RAM.

You can choose to store data in the stack:

StaticJsonBuffer<512> jsonBuffer

…or on the heap

DynamicJsonBuffer jsonBuffer(512)

This allocation strategy reduces the heap fragmentation.

Intuitive Syntax

ArduinoJson has a simple and intuitive syntax to handle object and arrays.

JsonObject& root = jsonBuffer.parseObject(myJson);

const char* city = root["city"];
double temp = root["weather"]["temp"];

Implicit or Explict Casts

ArduinoJson supports two coding styles, with implicit or explicit casts

Implicit cast:

const char* city = root["city"];
float temp = root["temperature"];

Explicit cast:

auto city = root["city"].as<const char*>();
auto temp = root["temperature"].as<float>();

Parse From Stream

ArduinoJson is able to parse directly from an input Stream or std::istream

Parse input from the serial port:

JsonObject& root = jsonBuffer.parse(Serial);

…an Ethernet connection

JsonObject& root = jsonBuffer.parse(ethernetClient);

…or a Wifi connection

JsonObject& root = jsonBuffer.parse(wifiClient);

Compatible with Flash Strings

ArduinoJson works directly with strings stored in program memory (PROGMEM)

You can use a Flash String as JSON input

JsonObject& root = jsonBuffer.parseObject(F("{\"city\":\"Paris\",\"temp\":18.5}"));

…as a value

root["cond"] = F("Sunny");

…or as a key

float temp = root[F("temp")];

Print to Stream

ArduinoJson is able to print directly to a Print or std::ostream

// Send the JSON to the serial port

…an Ethernet connection


…or a Wifi connection


Self Contained

ArduinoJson is doesn’t depend on any library; in fact, it doesn’t even depend on Arduino!

This means you can use ArduinoJson anywhere you can compile C++ code.

The best example is your test suite: you can comfortably test your program on your computer without touching a microcontroller.

Try online

You can try ArduinoJson online on

MIT License

ArduinoJson is open-source and uses one of the most permissive licenses so you can use it on any project.

✔️️ Commercial use

✔️️ Modification

✔️️ Distribution

✔️️ Private use


ArduinoJson is a header-only library, meaning that all the code is the headers.

This greatly simplifies the compilation as you don’t have to worry about compiling and linking the library.

A single file distribution is also available; that way, you just need to download one header.

Continuous fuzzing

Security is considered very seriously.

That is why ArduinoJson is integrated in Google’s OSS-Fuzz program.

As such, it is continuously fuzzed in search for security vulnerabilities.

Give back!

The library is free; you don’t have to pay anything.

However, if you want to support the development, or just thank the author of the library, you can purchase the book Mastering ArduinoJson.

Not only you’ll encourage the development of the library, but you’ll also learn how to best use the library and probably some C++ too ;-)


Nick Koumaris
Your library is a life-saver. Thank you for this excellent tool!
Peter Dalmaris
Arduino makers can use ArduinoJson in their projects to connect multiple Arduino gadgets, or Arduinos to their web services. The library includes a powerful parser which can deal with nested objects (great for customising the messaging format to fit with your objectives), it is light on memory (both RAM and flash), and it has a really nice API so it’s easy to use.
Nuno Santos
Thanks for your great work on this awesome library, I will definitely keep using it in my projects and recommend to others :)
AJ Keller
I love ArduinoJson! Keep up the great work!
Hemal Chevli
ArduinoJson library should be used as a benchmark/reference for making libraries. Truly elegant.
Mike Karlesky
You've clearly done a tremendous amount of very good work. In fact, the existence of ArduinoJson was a key input into the decision and design process for our system's architecture a couple years ago.
It has a really elegant, simple API and it works like a charm on embedded and Windows/Linux platforms. We recently started using this on an embedded project and I can vouch for its quality.
I've been watching you consistently develop this library over the past six months, and I used it today for a publish and subscribe architecture designed to help hobbyists move into more advanced robotics. Your library allowed me to implement remote subscription in order to facilitate multi-processor robots.
its a great lib:) and i use it in everything!
This is a great library and I wouldn't be able to do the project I'm doing without it. I completely recommend it.
I am just starting an ESP8266 clock project and now I can output JSON from my server script and interpret it painlessly.
I tried aJson and json-arduino before trying your library. I always ran into memory problem after a while. I have no such problem so far with your library. It is working perfectly with my web services. Thanks Benoit for a very well polished product!
Jeff Kletsky
That I can work through use of ArduinoJson without ever touching a MCU is a huge plus! Kudos on what must have been a non-trivial task!

The most popular library

ArduinoJson is currently the most popular Arduino library on GitHub and PlatformIO.

We need your help to stay there, so don't forget to add a star .