Pretty-print or minify
Indent with 2, 4 or 8 spaces for reading, or minify to a single line for payloads and environment variables.
Validate JSON, see exactly where it breaks, and fix common mistakes in one pass.
Each line of the output, in default formatting, next to the path of the value it holds. Click a row to copy the path.
Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.
Config files, JavaScript objects and copied log lines are often almost-JSON. Lenient parsing reads them, and the output is strict JSON.
{
// comments are not allowed in JSON
name: 'web-api',
"ports": [80, 443,],
"debug": false,
} {
"name": "web-api",
"ports": [
80,
443
],
"debug": false
} Turn off Lenient JSON to check a file against the strict standard (RFC 8259). These are the mistakes it flags most often.
| Error | Example | Fix |
|---|---|---|
| Trailing comma | [1, 2, 3,] | Delete the comma after the last item. |
| Single quotes | {'name': 'app'} | Use double quotes for keys and strings. |
| Unquoted key | {port: 8080} | Wrap every key in double quotes. |
| Comment | // note or /* note */ | Remove it, or keep the note in a "comment" key. |
| Missing comma | {"a": 1 "b": 2} | Separate members and items with commas. |
| Unescaped quote | "say "hi"" | Escape inner quotes as \". |
| NaN, Infinity, undefined | {"ratio": NaN} | Use null or a string; JSON only has finite numbers. |
Indent with 2, 4 or 8 spaces for reading, or minify to a single line for payloads and environment variables.
Sort keys alphabetically at every level so two versions of a file produce a clean, readable diff.
Errors are explained in plain words with the line and column, and the line is highlighted in the editor.
64-bit IDs such as 9223372036854775807 keep every digit, where many formatters silently round them.
Inputs up to 5 MB are supported. Above 512 KB, formatting waits for the Format button to keep typing smooth.
Valid JSON converts to YAML in one click with the JSON to YAML converter.
Converters, validators and step-by-step guides for every place JSON and YAML meet.
Paste or upload your JSON. A pretty-printed version appears on the right, indented with 2, 4 or 8 spaces. Turn on Minify for a single-line version, or Sort keys for a stable, diff-friendly order. Then copy or download the result.
Paste it into the editor. The status badge shows Valid JSON or Invalid JSON as you type, and an invalid document gets a plain-language error with the exact line and column. Go to error moves the cursor to the problem.
Yes, for the most common mistakes. With Lenient JSON on, comments, trailing commas, single-quoted strings and unquoted keys are accepted, and the output on the right is strict, valid JSON. Copy the output to use the fixed version.
No. Only whitespace and, if you choose, key order change. Numbers keep their value; integers larger than 2^53, such as 64-bit IDs, keep every digit instead of being rounded.
No. Formatting and validation run locally in your browser. Nothing you paste is uploaded, logged or stored.
Yes. A file with one JSON value per line is detected automatically and combined into a single formatted JSON array, which is easier to read and to diff.