Toolverse

JSON Formatter & Validator

Beautify, minify and validate JSON right in your browser. Paste your JSON to pretty-print it with your chosen indentation, or minify it to a single line.

Output

How to use it

JSON (JavaScript Object Notation) is the standard text format for exchanging structured data between APIs, config files, and applications — it's built from objects (key-value pairs in curly braces), arrays (ordered lists in square brackets), and a handful of value types: strings, numbers, booleans, null, and nested objects or arrays. Because it's just text, a single missing comma or stray character makes the whole document unreadable to a parser. Formatting and validation solve two different problems: formatting (pretty-printing) re-indents the text so its structure is obvious to a human eye, while validation checks that the text is actually syntactically correct JSON before any code tries to parse it. Imagine a small object that arrives from an API all on one line, pairing a "user" key with the string "ada", an "active" key with the boolean true, and a "roles" key with the array ["admin", "editor"] — everything crammed together with no spaces. Beautifying it with a 2-space indent puts each key on its own indented line, one under the next, so the "user", "active", and "roles" entries, plus the nested roles array, are all easy to scan at a glance. Minifying does the opposite: it strips every space, tab, and line break the format doesn't require, collapsing the beautified version straight back to the original compact string. Minifying doesn't change what the data means — it only removes whitespace that exists for human readability, which is why it's safe to minify before sending JSON over the network but pointless to minify before reading it yourself. Validation catches the mistakes that are easy to make by hand and easy to miss by eye: a trailing comma after the last item in an object or array (valid in JavaScript object literals, invalid in JSON), object keys written without quotes, strings wrapped in single quotes instead of double quotes, and a bracket or brace that was opened but never closed. JSON's grammar has no tolerance for any of these — unlike JavaScript, which accepts looser syntax, a JSON parser rejects the entire document on the first error it finds. Fixing invalid JSON usually means working through the errors from the top: add double quotes around keys and string values, remove the last comma before a closing brace or bracket, and count your braces to make sure every open has a close. Indent size is a matter of convention rather than correctness — 2 spaces is common in JavaScript/TypeScript and web config files because it keeps deeply nested objects narrower, 4 spaces is more common in Python-adjacent tooling and style guides that prioritize visual separation between levels, and tabs let each reader's editor render the width they prefer. None of these affect how the JSON parses; pick whichever matches the file you're editing or the convention your team already uses. Formatting and validating JSON comes up constantly: debugging an API response that arrived minified in a network tab, checking a hand-edited config file (like a package.json or tsconfig.json) before it breaks a build, cleaning up JSON copied out of a log line or error message so it's readable, and minifying JSON before storing or transmitting it to shave bytes off a payload — even a modest reduction adds up across millions of requests.

Frequently asked questions

Is my JSON sent to a server?
No. Formatting, minifying and validation all happen in your browser — your data never leaves your device.
What does the validator check?
It parses your text as strict JSON and reports the first syntax error, including the line and column where it was found when your browser provides it.
What's the difference between beautify and minify?
Beautify adds indentation and line breaks to make JSON readable; minify removes all unnecessary whitespace to make it as small as possible.
How do I fix invalid JSON?
Read the error message first — it usually points to the line and column where parsing failed. The most common causes are a trailing comma before a closing brace or bracket, object keys or string values wrapped in single quotes instead of double quotes, and a missing closing bracket. Fix the first error, validate again, and repeat until the document parses cleanly.