JSON Formatter

Format, validate, and minify JSON with syntax error detection, entirely in your browser.

Valid JSON
Input
Formatted output

About the JSON Formatter

JSON (JavaScript Object Notation) is a text data format built from six value types: objects ({...}), arrays ([...]), strings, numbers, booleans, and null. It looks like JavaScript but is stricter — keys and string values must use double quotes, trailing commas aren't allowed, and comments have no place in the spec at all. This tool validates against those exact rules using the browser's native JSON.parse, so an error here means the JSON would also fail to parse in any standard JSON consumer, not just a stylistic complaint.

To use it: paste or type JSON into the input box — it validates on every keystroke, showing "Valid JSON" or the exact parse error. Click Format to re-indent it with 2 or 4 spaces per level for readability, or Minify to strip every non-essential space and line break for the smallest possible payload. For example, the compact input {"name":"WikiSolutions","tools":16} formats with 2-space indent to a three-line, easy-to-scan block, while minifying a formatted document returns it to that same compact single line. The formatted output can be copied or downloaded as a .json file directly from the output panel.