JSON Formatter
Paste JSON to validate it, pretty-print it with indentation, or minify it into a single line. Errors are explained in plain language.
How it works
Format indents your JSON with 2 spaces so it's easy to read; Minify strips all unnecessary whitespace for compact storage or transmission; Validate checks the syntax and tells you exactly what's wrong, including the position of the error. Your data never leaves your browser.
How to use
- Paste your JSON into the input box.
- Click Format (pretty) for readable two-space indentation, Minify for a compact single line, or Validate to check the syntax without changing anything. Validating first is a good habit before pasting JSON into config files or API consoles.
- If there is an error, the message explains it in plain language and tells you where it is — fix it and validate again.
- Click “Copy result” to grab the output; “Clear” empties both boxes to start over.
Frequently asked questions
What usually makes JSON invalid?
The classic culprits: single quotes instead of double quotes, trailing commas after the last item, unquoted keys, and comments. All of those are fine in JavaScript but illegal in strict JSON. A missing closing brace or bracket is another frequent one — the reported error position usually lands right where the structure broke.
What is the difference between Format and Minify?
Format adds two-space indentation so humans can read the structure; Minify strips all unnecessary whitespace for compact storage or transmission. The data itself is identical either way. Minified JSON is what APIs actually send over the wire: a pretty-printed payload shrinks noticeably once indentation and line breaks are gone.
Does Validate change my JSON?
No. It only checks the syntax and reports the first error it finds, including its position — your input is left untouched.
Is my data uploaded anywhere?
No. Parsing and formatting happen entirely in your browser; nothing you paste is sent, stored, or logged.