JSON tools
Enter JSON in the box below to validate it. If there is a syntax error, there will be a red x in a circle on the line with the syntax error.
- The Prettify button reformats the JSON to be one key/value pair per line, which is easier to read.
- The Compact button removes the excess whitespace and converts everything to a single line.
- The Stringify button converts JSON into a string, escaping double quotes and backslashes, and Unicode.
- The Unstringify button converts a string back into JSON, removing the escaping.
- The Escape Unicode button converts characters >= 127 to a four-digit hex Unicode escape sequence.
The five buttons only work when the JSON is valid. If there are syntax errors, the buttons will be grayed out.
Convert to code
Sometimes you will want to convert JSON data into static strings in your C++ application firmware. The tool below will convert the JSON above into code.
Convert to CBOR
CBOR is a compact binary representation of structured data that can be converted to and from JSON.
Variant generator
Using the Variant class to generate JSON data on-device can simplify your code and greatly reduce data size, because in Device OS 6.2 and later, your object is transparently converted to CBOR over the air and converted to JSON in the cloud.