JSON formatter and validator
Paste JSON to pretty print it, check it and explore it as a tree. If something is wrong, you get the exact line and column of the error.
- Input size
- 0
- Output size
- 0
- Keys
- 0
- Depth
- 0
The JSON is checked against the strict JSON standard as you type. Numbers are written back exactly as you entered them, so long IDs keep every digit. Nothing is uploaded: the data stays in your browser. Comments, single quotes and trailing commas are not valid JSON and are reported as errors.
How to use it
- Paste your JSON into the input box, or press Example to try it.
- Read the status line: it says Valid JSON, or shows the line, column and reason for the error.
- Choose 2 spaces, 4 spaces, tab or minified output, and tick Sort keys if you want them alphabetical.
- Switch to Tree to browse and copy a path, then copy or download the result.
What it does
Exact error positions
Errors report the line and column with a short explanation and a marked excerpt, and "Go to the error" jumps to the spot in your input.
Pretty print or minify
Indent with 2 spaces, 4 spaces or a tab, or squeeze the JSON into one line to save space.
Collapsible tree view
Browse nested data, expand or collapse branches, and click any node to see and copy its path such as $.items[0].name.
Sort keys
Order every object alphabetically by key to make two documents easy to compare.
Numbers stay exact
Numbers are written back as typed, so a 20-digit ID or a value like 1.0 is not rounded or rewritten.
Copy, download, reuse
Copy the result, save it as a .json file, or move it back into the input to keep working.
Good to know
JSON from an API, a log or a config file often arrives as one long line, and a single missing comma can make it unusable. This formatter checks the text against the strict JSON standard as you type. The message tells you what was expected, for example a comma or a closing bracket, and points to the exact line and column with a caret under the character, so you can fix it without hunting.
The tool is strict on purpose. Comments, single-quoted strings, unquoted property names and trailing commas are valid in JavaScript but not in JSON, so they are flagged. Duplicate keys are kept as written. Very large numbers keep every digit, because the formatter does not convert them to floating point. Large documents work in tree view too: long arrays are shown in pages, and everything stays in your browser, so private data is never uploaded.
Questions and answers
How do I format JSON online?
Paste it into the input box. The formatted result appears on the right straight away; pick 2 spaces, 4 spaces or a tab for the indent.
How do I find the error in my JSON?
The status line shows the line and column and the reason, with an excerpt and a caret. Press "Go to the error" to place the cursor there.
How do I minify JSON?
Choose "Minified" in the Output options. All spaces and line breaks outside strings are removed and the result is a single line.
Why is my JSON with comments or single quotes rejected?
JSON does not allow comments, single quotes or trailing commas, even though JavaScript does. Remove them and the JSON becomes valid.
Does it change my numbers?
No. Numbers are kept exactly as you typed them, including long IDs and values such as 1.50.
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser and nothing is uploaded.