Paste raw JSON from an API response, config file, or log output and get it prettified with syntax highlighting in one click. Switch to Minify mode to strip all whitespace for production use. Invalid JSON is caught immediately with an exact error message pointing to the problem.
How to Use
- Paste your JSON into the Input panel on the left
- The output formats automatically — choose Prettify for readable indented JSON or Minify for compact single-line output
- Switch between 2 spaces and 4 spaces indentation when in Prettify mode
- If your JSON is invalid, a red error message appears below the input with the exact parse error
- Click Copy to copy the formatted output to your clipboard
- Click Clear to reset both panels
JSON Formatting Modes
| Mode | What It Does | When to Use |
|---|---|---|
| Prettify | Adds line breaks and indentation | Reading, debugging, documentation |
| Minify | Removes all whitespace | Production configs, API payloads, storage |
2-space indentation is the most common style in JavaScript and Node.js projects. 4-space matches Python, Java, and most IDE defaults. Both produce identical data — the difference is purely visual.
Why Validate JSON?
JSON is strict about syntax. Common mistakes that cause parse failures include:
- Trailing commas —
{"key": "value",}— the final comma before}or]is not allowed in JSON (it is allowed in JavaScript) - Single quotes — JSON requires double quotes
"around all strings and keys. Single quotes'are invalid - Unquoted keys —
{key: "value"}is valid JavaScript but invalid JSON — keys must be quoted strings - Comments — JSON does not support
//or/* */comments. If you have a config file with comments, strip them before parsing - Undefined and NaN — These JavaScript values have no JSON equivalent. They will cause a serialisation error
The validator catches all of these and returns the exact position of the first error.
Common Use Cases
- API debugging — Paste a raw API response to read it clearly before writing code to consume it
- Config file editing — Format a dense production config to review settings without missing a field
- Data comparison — Prettify two JSON blobs before diffing them side by side in a text editor
- Payload size check — Minify a JSON payload to see its actual byte size before including it in an HTTP request
- Documentation — Format a JSON example neatly before pasting it into a README, Confluence page, or API doc
- Log inspection — Many services log events as single-line JSON. Paste a log line and prettify it to read the full structure
Frequently Asked Questions
JSON.parse() and JSON.stringify() functions. Nothing is transmitted.