The JSON Formatter takes JSON pasted into the input box and does one of two things: Format / Beautify rewrites it in a readable, indented layout, or Minify rewrites it in the most compact form. Either action also validates the input, because the text must parse successfully before it can be rewritten.
The result appears in a separate read-only output box, with a Copy button to copy it, and a message line that confirms success or reports the parser's error for invalid input.
Both actions use the browser's built-in JSON functions. The input is first parsed into a JavaScript value with JSON.parse; if parsing throws an error, that error message is shown and no output is produced. If parsing succeeds, Format writes the value back out with JSON.stringify using a two-space indent, while Minify writes it out with no extra spacing.
The tool formats, minifies and validates only — it does not sort keys, convert between data formats, or repair broken JSON; invalid input simply reports the parser error so you can fix it yourself. Key order in the output follows the parsed value's order from the input. Everything runs locally in your browser using the built-in parser, so the exact wording of an error message depends on your browser.
Pasting {"name":"ToolGlobalHub","free":true} and choosing Format / Beautify produces the same object spread over four lines with two-space indentation, one key per line, and the message Valid JSON ✓.
Pasting the same text with a trailing comma after true makes JSON.parse fail. The tool shows Invalid JSON followed by the browser's parse error message, and the output box is left unchanged, so you know the problem is in the input, not the tool.
Two spaces per level. The Format / Beautify button re-serialises the parsed JSON with a two-space indent argument, one key per line.
Yes. The input is parsed first, and parsing is the validation step. Valid input is confirmed with a Valid JSON ✓ message; invalid input shows the parser's error message instead of a result.
Minify re-serialises the parsed value with no spacing argument, which removes indentation and line breaks and leaves the compact single-line form of the same data.
No. If parsing fails, the tool only reports the error message from the browser's parser. It does not attempt repairs, add missing quotes or remove trailing commas.
No upload step exists in the tool. Parsing and formatting happen with JavaScript in your browser, and the Copy button only writes the output to your clipboard.
Other developer and converter tools in the same category.
Color Converter — Convert a colour between HEX, RGB and HSL values.
Unit Converter — Convert length, weight and temperature between common units.
URL Slug Generator — Turn a title into a lowercase, hyphen-separated URL slug.
Converters — Browse the full Converters category on ToolGlobalHub.