Parsing comes before formatting
The browser first parses the entire document as JSON. Missing quotes, trailing commas, comments, and unescaped control characters are rejected because they are outside the JSON grammar.
Format, validate, and beautify JSON with syntax highlighting and error detection.
How to use
Enter the JSON string you want to format and validate.
Click format to pretty-print with proper indentation.
Click copy to grab the cleanly formatted JSON output.
The guide
Use this formatter when a JSON document is difficult to read or a parser rejects it. The tool runs JSON.parse to validate the input, then JSON.stringify to produce either indented or compact output. It does not repair invalid JSON silently, so a syntax error remains visible instead of being guessed away.
A concrete input and expected output from the current implementation.
Input
{"name":"b2KIT","private":true,"tools":2769} Expected output
{
"name": "b2KIT",
"private": true,
"tools": 2769
} With two-space indentation selected, the three properties are placed on separate lines. The strings, Boolean value, and number keep their original JSON types.
The browser first parses the entire document as JSON. Missing quotes, trailing commas, comments, and unescaped control characters are rejected because they are outside the JSON grammar.
Pretty printing changes whitespace only. Minification removes optional whitespace, but property names, array order, values, and nesting remain the same after a successful parse.
No. This implementation serializes the parsed object in its existing property order. Consumers should still avoid treating JSON object order as a data contract.
No. Parsing and serialization happen in the browser. Avoid pasting secrets into any shared or untrusted device even when processing is local.
The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.
Sent. Thank you.