JSON Formatter & Validator
Format, minify or check JSON, and get told exactly which line is broken when it is.
Indent
What this tool does
JSON arrives in two unhelpful states: one enormous line with no spaces, or almost-valid text that some parser is refusing without saying why. Formatting solves the first by re-indenting the structure so you can see the nesting. Validating solves the second by pointing at the specific line and column where the syntax breaks.
Nothing about the data changes. Formatting and minifying only add or remove whitespace between tokens, so the parsed value is identical either way — the file is just easier or smaller to work with.
When you might need it
- An API response is one long line
- Logs and network tabs return minified JSON. Formatting it is usually the difference between finding the field you need in five seconds and five minutes.
- Something rejected your config file
- A tool says "invalid JSON" and stops. This tells you it is line 34, column 7, and shows you that line.
- Before pasting into a ticket
- Formatted JSON in a bug report means whoever picks it up can read the structure without reformatting it themselves.
- Trimming a payload
- Minifying strips every optional space and newline, which is worth doing before sending JSON over a slow connection or storing a lot of it.
Common workplace uses
- Checking an integration payload
- Paste what a vendor sent, confirm it is valid, and see which fields are actually present rather than assumed.
- Editing a configuration file
- Reformat a config you have been hand-editing to spot the missing brace before the deployment does.
- Reading an export
- Analytics and CRM exports are frequently minified JSON. Formatting makes the record shape obvious.
- Comparing two responses
- Format both with the same indent so a diff shows real differences instead of whitespace noise.
How to use it
Paste your JSON
Drop it into the input box. Large documents are fine — tens of thousands of records format without trouble.
Choose an indent
Two spaces, four spaces or a tab. Match whatever the rest of your project uses so the result can be pasted straight back.
Pick an action
Format re-indents it. Minify strips whitespace. Validate only checks it and reports the structure without changing anything.
Read the result — or the error
Valid JSON appears in the output box with a summary of its shape. Invalid JSON produces the reason, the line and column, and a caret pointing at the character.
Copy or download
Copy puts the output on your clipboard; Download saves it as a .json file.
Practical tips
- The error points at where parsing stopped, not always where you went wrong
- A missing comma on line 12 is often reported at line 13, because that is where the parser first saw something impossible. Check the line above the one named.
- Trailing commas are the most common cause
- JavaScript allows a comma after the last item in an object or array. JSON does not. If your file came from code, look there first.
- JSON requires double quotes
- Single quotes around keys or strings are valid JavaScript and invalid JSON. This is why a config copied out of a code file often fails.
- Minified and formatted JSON are interchangeable
- Whatever consumes your JSON does not care about the whitespace. Format it for humans, minify it for transmission, and the parsed data is the same.
- Comments are not allowed
- If your file has // or /* */ in it, it is JSONC or JSON5, not JSON. Strip the comments before validating.
Common questions
Is my data sent anywhere?
How large a file can it handle?
Why does it say invalid when my editor accepts it?
Does formatting change my data?
What does the structure summary mean?
Can it fix my JSON automatically?
Related workflows
Debugging an API response
Turning a wall of minified JSON into something you can reason about.
- { } JSON FormatterFormat the response so the structure is visible
- Locate the fieldCheck the value is present and the type is what you expected
- 🔡 Base64 EncoderIf a field holds an encoded token or blob, decode it