ToolFox

What Is JSON, and How to Read and Format It

20 September 2026 · 5 min read

JSON, short for JavaScript Object Notation, is the format most of the web uses to send data between programs. If you have ever looked at an API response, a configuration file or the data behind an app, you have almost certainly seen JSON. It is designed to be easy for both machines and people to read — once you know the handful of rules.

This guide covers what JSON is, its syntax, and the small mistakes that break it. You can paste any JSON into the JSON formatter and validator to tidy it up and catch errors instantly.

The building blocks

JSON is built from two kinds of container. An object is a set of key–value pairs wrapped in curly braces, like {"name": "Asha", "age": 30}. An array is an ordered list wrapped in square brackets, like [1, 2, 3]. Objects and arrays can nest inside each other to any depth, which is how JSON represents complex data.

Values can be strings (in double quotes), numbers, true, false, null, or another object or array. That short list is the whole vocabulary — JSON is deliberately minimal.

The syntax rules that trip people up

Most broken JSON comes down to a few rules. Keys and string values must use double quotes, never single quotes. There must be no trailing comma after the last item in an object or array. Every opening brace or bracket needs a matching closing one. And comments are not allowed in standard JSON, even though many people expect them to be.

These rules are strict on purpose: because JSON has no ambiguity, any program in any language can parse it the same way.

Common errors and how to spot them

The usual culprits are a missing comma between items, an extra comma after the last one, a quote that was never closed, or a curly brace that does not have its partner. In a large, unformatted block these are almost impossible to find by eye.

That is exactly what a formatter is for. Pasting the text into the JSON formatter re-indents it into a readable tree and points to the exact spot where the structure breaks, which turns a frustrating hunt into a two-second fix.

Why formatting matters

Data sent over a network is usually "minified" — all the spaces and line breaks stripped out to save bandwidth — which makes it one long, unreadable line. Formatting (also called pretty-printing) adds the indentation back so the structure is visible at a glance. It changes nothing about the data itself; it only changes how it looks, making it far easier to understand and debug.

Frequently asked questions

What does JSON stand for?

JavaScript Object Notation. Despite the name it is language-independent and used far beyond JavaScript.

Can JSON have comments?

No. Standard JSON does not allow comments. Some tools accept them as an extension, but strict parsers will reject them.

Why is my JSON invalid?

The most common causes are single quotes instead of double quotes, a trailing comma after the last item, an unclosed quote or bracket, or a comment. A validator will point to the exact line.

Does formatting change my data?

No. Formatting only adds indentation and line breaks for readability. The underlying data is identical.

Tools in this guide

← All guides