JSON Formatter
Paste any JSON below to instantly validate it, beautify it with proper indentation, or minify it to a single line. Invalid JSON shows a clear error with the line and column where parsing failed.
How to use
- 1
Paste your JSON
Drop any JSON object, array, or value into the input box.
- 2
Check validity
Invalid JSON shows an error message with the exact line and column.
- 3
Choose Beautify or Minify
Switch between a readable, indented view and a compact single-line version.
- 4
Copy the result
Click Copy to grab the formatted output to your clipboard.
Examples
- {"a":1,"b":2} → Beautified: {\n "a": 1,\n "b": 2\n}
- {"a": 1, "b": } → Error: Unexpected token, with line and column shown
Frequently asked questions
How does the error location work?
When JSON.parse fails, the browser reports a character position. This tool converts that position into a line and column number so you can find the problem quickly in longer documents.
What's the difference between Beautify and Minify?
Beautify re-indents your JSON with 2-space indentation for readability. Minify strips all whitespace to produce the smallest possible payload, useful before sending JSON over a network.
Does this tool validate against a schema?
No, it only checks that the JSON is syntactically valid (well-formed). It doesn't check field types or required keys against a schema.
Is my JSON stored anywhere?
No. Parsing and formatting happen entirely in your browser. Nothing is sent to a server or saved.