How to do it?
- 1.
Paste your JSON
Paste JSON into the left box, open a .json file or insert the sample.
- 2.
Choose a mode
Beautify adds indentation (2 spaces, 4 spaces or tab); Minify strips all unnecessary whitespace.
- 3.
Copy or download
Copy the result or download it as a .json file.
Common JSON errors
- Trailing comma -
{"a": 1,}is invalid. - Single quotes - keys and strings must use double quotes.
- Unquoted keys -
{a: 1}is a JavaScript object literal, not JSON. - Comments - JSON (RFC 8259) has no comments; that is JSON5/JSONC.
- Raw newlines in strings - use
\n.
Beautify or minify?
Beautify (pretty print) adds indentation and line breaks so the structure is easy to read, review in Git and debug when inspecting an API response. Minify removes spaces, tabs and newlines outside strings, typically cutting the size by 20-40% and speeding up transfer. Example: { "a": [ 1, 2 ] } minified becomes {"a":[1,2]}.
Sort keys orders object keys alphabetically at every level (arrays keep their order). Run it on two versions of the same document and the differences line up, which makes comparing them much easier.
JSON data types
- object -
{"key": value}, keys always in double quotes, - array -
[1, 2, 3], - string -
"London"(escapes:\" \\ \n \t \uXXXX), - number -
42,-3.14,1e6(no leading zeros, no NaN or Infinity), - booleans
true/falseandnull.
Anything else - undefined, dates, functions, comments - is not JSON. Dates are usually sent as ISO 8601 strings such as "2026-10-11T09:30:00Z".
How to read the error message
The validator reports the line, column and character position where parsing failed and shows a code excerpt with a caret. The reported spot is often after the actual mistake: a missing comma between items on line 12 is reported at the start of line 13, and an unclosed quote is only detected at the end of the document as “unexpected end of data”. Check the marked character first, then the token right before it.
The validator follows RFC 8259 / ECMA-404. Files with comments and trailing commas, such as VS Code settings, are JSON5 or JSONC and will be reported as invalid by JSON.parse.
Frequently asked questions
Is my JSON sent to a server?
+
Why is my JSON invalid when it works in JavaScript?
+
Can large numbers lose precision?
+
What does “sort keys” do?
+
What is the difference between JSON and JSON5?
+
Can I open a .json file?
+
Updated: