What JSON is, in one honest paragraph
JSON — JavaScript Object Notation — is a text format for structured data that has become the default language of web APIs. A JSON document is built from just a few pieces: objects, written as key–value pairs inside curly braces; arrays, written as ordered lists inside square brackets; and the values those containers hold, which can be strings, numbers, booleans, null, or further objects and arrays. Keys must be double-quoted strings, strings themselves must be double-quoted, and the grammar is deliberately small enough to describe on an index card. That strictness is the point: two programs that have never met can exchange a JSON document and agree exactly on its structure, in almost any programming language.
Why formatting matters
The same JSON document can be written as one unreadable line or spread across an indented page, and both versions mean exactly the same thing to a parser. Humans, however, are not parsers. APIs often return minified JSON to save bandwidth, which is efficient for machines and miserable for the developer trying to find one wrong value in a payment response at midnight. Pretty-printing with consistent two-space indentation exposes the nesting at a glance: you can see which fields belong to which object, spot the array that should have been an object, and compare two responses side by side. Minifying is the same operation in reverse — useful before embedding JSON in a request, a config file with a size limit, or a test fixture where compactness matters more than readability.
The errors everyone meets, and what they mean
Most invalid JSON fails for a handful of familiar reasons. Trailing commas — a comma after the last item in an object or array — are legal in JavaScript code but illegal in JSON. Single quotes are another classic: JSON demands double quotes around every string and key. Comments are not allowed at all, which surprises people arriving from configuration files that permit them. When this tool rejects your input, it reports the parser's own error message and, where the browser provides a character position, converts it into a line and column so you can look at the exact spot. Often the real mistake sits a character or two before the reported position, because the parser only notices trouble when it reaches the next token.
How to use this tool
Paste or type your JSON into the input box. Press Format for an indented, readable version, Minify for a single compact line, or Validate if you only want a verdict without changing anything. A valid document earns a success message plus small statistics — its size in bytes, its top-level type, and how many keys or items it holds — which are handy for a quick sanity check. Copy output moves the result to your clipboard ready to paste into code, a ticket, or a request body. Clear empties both boxes. Parsing and formatting run entirely in JavaScript on your device, and closing the tab discards everything.
A note on what validation cannot tell you
Valid JSON is not necessarily correct JSON. A document can parse perfectly while holding a string where the API expects a number, a missing required field, or a date in the wrong format. Syntax validation, which is what this tool performs, answers “is this well-formed JSON?” — not “will the receiving system accept it?” For the second question you need the API's schema or documentation.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing, formatting and minifying all use the JSON functions built into your browser. You could load this page, disconnect from the internet, and it would keep working.
Why does the error position not match the mistake?
Parsers report where they gave up, which is often just after the actual error — for example at the token following a missing comma. Check the reported line and the line above it first.
Can I format JSON with comments or trailing commas?
Not as JSON, because the standard forbids both. The relaxed variants that allow them are usually called JSON5 or JSONC; remove the comments and trailing commas and this tool will handle the result.
What counts as one “key” in the statistics?
For a top-level object, the number of keys it holds; for a top-level array, the number of items. Nested structures are counted only as part of the byte size.
Related tools
- DNS Lookup — another API staple: resolve any hostname.
- SSL Checker — inspect the certificate serving your API.
- What Is My IP — the address APIs see when you call them.
- Password Generator — generate the API keys you keep out of JSON files.
- Subnet Calculator — plan the networks your services run on.
- Speed Test — check the connection your requests travel over.