Intuitive Syntax

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

deserializeJson(doc, input);

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


In addition to JSON, ArduinoJson 6 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!

Serialize and Deserialize

ArduinoJson supports both JSON serialization and deserialization.

Read JSON:

deserializeJson(doc, myInput);


doc["last_modification"] = time();

…write back:

serializeJson(doc, myOutput);

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:

StaticJsonDocument<256> doc;

…or on the heap

DynamicJsonDocument doc(2048);

This allocation strategy reduces heap fragmentation.

Parse From Stream

ArduinoJson can parse directly from an input Stream or std::istream

Parse input from the serial port:

deserializeJson(doc, Serial);

…an Ethernet connection

deserializeJson(doc, ethernetClient);

…or a Wifi connection

deserializeJson(doc, wifiClient);

Print to Stream

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

// Send the JSON to the serial port
serializeJson(doc, Serial);

…an Ethernet connection

serializeJson(doc, ethernetClient);

…or a Wifi connection

serializeJson(doc, wifiClient);

Flash Strings

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

You can use a Flash String as JSON input

deserializeJson(doc, F("{\"city\":\"Paris\",\"temp\":18.5}"));

…as a value

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

…or as a key

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

Implicit or Explicit Casts

ArduinoJson supports two coding styles, with implicit or explicit casts

Implicit cast:

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

Explicit cast:

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


When parsing a JSON document from an input stream, ArduinoJson stops reading as soon as the document ends (e.g. at the closing brace).

This feature allows to read JSON documents one after the other; for example, it allows to read line-delimited formats like NDJSON or JSON Lines.


Self Contained

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

It 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.


ArduinoJson uses only the C++98 standard, so it doesn’t require a modern C++ compiler, which means you can use it with your old vendor toolchain.

ArduinoJson is continuously tested on:

  • GCC 4.6, 4.7, 4.8, 4.9, 5, 6, and 7
  • Clang 3.5, 3.6, 3.7, 3.8, 3.9, 4, 5, and 6
  • Visual Studio 2010, 2012, 2013, 2015, and 2017

Zero warning

ArduinoJson compiles without any warning, even with the highest compiler settings:

  • -Wall
  • -Wextra
  • -pedantic
  • /W4 on MSVC


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

This dramatically 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.

Try online

You can try ArduinoJson online on

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.

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

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 ;-)

They use ArduinoJson

Wifi Controlled Rover

Wifi Controlled Rover

An amazing 3D-printed rover that can be controlled via Wifi.

WiFi Weather Station

WiFi Weather Station

A Wifi weather station, using an ESP32 and a BME280 sensor. It fetches weather forecast from OpenWeatherMap.

ESP32 OpenWeatherMap
Animated truck that shows when a shuttle arrives

Animated truck that shows when a shuttle arrives

The crazy project of an animated truck that shows when a shuttle arrives.

Particle Photon TransLoc API
Social Stats Display

Social Stats Display

A frame with 7-segments displays that shows the number of followers on Twitter, Instagram and Instructables.

Air quality monitor

Air quality monitor

Atmoscan, a multisensor device aimed at monitoring indoor air quality.

Internet clock

Internet clock

AutoClock, a simple internet-enabled clock driven by NTP and GeoIP to give an automatic offset from UTP for your location.

WeMos D1 Mini
IoT Smart Wallet

IoT Smart Wallet

A smart wallet with a screen to monitor cryptocurrency assets.

ESP32 Google Spreadsheet
Smart(er) Underfloor Heating System

Smart(er) Underfloor Heating System

A thermostat that measures temperature and transfers the values to a backend. The backend analyses these values and sends instructions back to the device.

WeMos D1 Mini


A library for M5Stack to package you apps on a SD card and load them from a menu.

e-Paper Weather Display

e-Paper Weather Display

An ESP32 and a 2.9” ePaper Display reads Weather Underground and displays the weather

ESP32 Weather Underground
LAN/Network Monitor

LAN/Network Monitor

An IoT device that monitors all IoT devices

WeMos D1 Mini
Homie for ESP8266

Homie for ESP8266

An Arduino for ESP8266 implementation of Homie, an MQTT convention for the IoT.

3D Printer Monitor for OctoPrint

3D Printer Monitor for OctoPrint

Monitor your 3D Printer’s OctoPrint Server on an OLED display over a wifi connection.

WeMos D1 Mini
Clock News Weather Scrolling Marquee

Clock News Weather Scrolling Marquee

A LED display that shows weather, time, and many other things.

WeMos D1 Mini
Motor on a roller blind

Motor on a roller blind

Adds wifi remote control to roller blinds

WiFi LED Light Strip Controller

WiFi LED Light Strip Controller

A fully-functioning WiFi controller for your LED lights, along with an app for your iOS or Android phone or tablet.

Location Tracker

Location Tracker

A location tracker without a GPS module and without display

NodeMCU Unwired Labs
YouTube Subscriber Counter

YouTube Subscriber Counter

An LCD display that shows the number of subscriber of your YouTube channel

NodeMCU YouTube
Amazon Alexa Smart Home

Amazon Alexa Smart Home

Control things with your voice

NodeMCU Sinric
ISS tracker

ISS tracker

Shows the location of the International Space Station

ESP32 Open Notify
Pool Monitoring

Pool Monitoring

Shows pH, ORP, and temperature of a pool or spa, and uploads the data to

ESP32 ThingsBoard
Facebook Fan Count

Facebook Fan Count

A frame that shows your number of fans on Facebook

NodeMCU Mini Facebook
Arduino MKR1000 - DHT - Artik cloud

Arduino MKR1000 - DHT - Artik cloud

Sending temperature and humidity from Arduino MKR1000 to Artik Cloud

MKR1000 Artik Cloud
AllThingsTalk Maker Platform & NodeMCU

AllThingsTalk Maker Platform & NodeMCU

Getting started project for “AllThingsTalk MAKER”. Client app works on NodeMCU

NodeMCU ATT Maker
IoT JumpWay TTM ESP8266 Arduino Temperature Device

IoT JumpWay TTM ESP8266 Arduino Temperature Device

A temp & humidity sensing device created on an ESP8266 12F that uses the IoT JumpWay for device-to-device communication

ESP8266 IoT JumpWay
Telegram Bot Library

Telegram Bot Library

Host a Telegram Bot on your Arduino and chat with your brand new IoT device!

MKR1000 Telegram


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!
Bon Shaw
Your library has greatly simplified my parsing and will make maintaining my code vastly easier in the future. I'll certainly be buying your book to shorten my learning curve and begin to take full advantage of your knowledge and library.
It's a great library and I have found it to be very useful in my Arduino projects. Wanted to test it on Raspberry Pi as well. Included the Headers in my project and it works flawlessly. Keep up the good work!!
Jason Meredith
Thanks again for making such a great library!
ArduinoJson is for me the best json library for microcontrollers! I'm a huge fan of it!
Ewald Comhaire
No other implementation was/is so memory efficient!
Very impressive library, very useful indeed. Thank you!

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 .