Beautify and prettify JSON with clean, consistent indentation.
JSON Tools
A complete set of JSON utilities for everyday development: prettify or compact a payload, escape and unescape strings, diff two documents, convert JSON to other formats, and explore large structures. Everything runs locally in your browser — nothing is uploaded.
Tools in this collection
Strip whitespace to produce compact, single-line JSON.
Explore, expand, and collapse large JSON trees.
Escape special characters to embed text inside a JSON string.
Decode escaped JSON strings back into readable text.
Compare two JSON documents side by side and highlight what changed.
Construct a JSON document visually with an editable node tree.
Generate a JSON Schema from an example document.
Turn JSON records into SQL DDL and insert statements.
Convert a JSON array of objects into CSV rows.
Validate, compact, and encode JSON as Base64.
Convert JSON into equivalent YAML.
Convert JSON into equivalent TOML.
Test JSONPath expressions against a sample document.
Practical guides
Inspect structure and values locally before you share a file.
Learn JSONPath selectors with runnable examples.
Produce realistic sample JSON for tests and demos.
Query and transform JSON on the command line with jq.
Continue exploring
Profile CSV and JSON structure and values locally.
Everything about querying JSON with jq, plus a playground.
Content reviewed .
What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. It is designed to be easy for humans to read and write, and easy for machines to parse and generate. JSON is often used to transmit data between a server and a web application, as an alternative to XML.
JSON data consists of a collection of key-value pairs, where each key is a string and each value can be a string, number, boolean, null, array, or another JSON object. JSON objects are enclosed in curly braces and key-value pairs are separated by a colon :. Arrays are enclosed in square brackets [] and their elements are separated by a comma ,.
Here is an example of a simple JSON object:
In this example, the object has five key-value pairs: name, age, isEmployed, pets, and address. The pets key has an array value with two string elements, and the address key has an object value with four key-value pairs.
How to use JSON in python?
Python provides built-in support for working with JSON data through the json module. Here are some basic examples of how to use json in Python:
This code uses the json.loads() function to parse a JSON string and convert it into a Python dictionary.
Serialize Python data to a JSON string
This code uses the json.dumps() function to serialize a Python dictionary to a JSON string.
Parse JSON data from a file
This code uses the json.load() function to parse JSON data from a file and convert it into a Python dictionary.
Serialize Python data to a file in JSON format
This code uses the json.dump() function to serialize a Python dictionary to JSON format and write it to a file.
See more information on working with JSON in Python on the official documentation page at https://docs.python.org/3/library/json.html.
How to work with JSON in Javascript
JavaScript has built-in support for working with JSON data through the JSON object. Here are some basic examples of how to use JSON in JavaScript:
This code uses the JSON.parse() method to parse a JSON string and retrieve the values of the corresponding properties.
Serialize JavaScript data to a JSON string
This code uses the JSON.stringify() method to create a JSON string from a JavaScript object.
Where to go next
Jump into any tool from the JSON Tools collection at the top of this page, or start with the JSON formatter, JSON diff viewer, or everything about jq.