What is JSON?
JSON (JavaScript Object Notation) is a lightweight text format for exchanging data — the common language of apps and APIs on the modern web. But JSON from servers is often minified onto one unreadable line, and one tiny mistake such as a trailing comma or missing quote makes it invalid. This tool helps you read and fix JSON fast.
What the tool does
- Beautify: add indentation and line breaks with 2 spaces, 4 spaces or tabs.
- Minify: strip whitespace to shrink size before sending or storing.
- Sort keys: alphabetize object keys at every level to make diffs easy.
- Validate: pinpoint errors by line and column and highlight the offending character.
- Convert to CSV: turn an array of objects into a table for Excel or Google Sheets.
Common JSON errors
| Error | Wrong | Right |
|---|---|---|
| Trailing comma | {"a":1,} | {"a":1} |
| Single quotes | {'a':1} | {"a":1} |
| Unquoted key | {a:1} | {"a":1} |
| Comments | // note | JSON doesn't allow comments |
| Unsupported values | undefined, NaN | Use null |
Developer tips
- Sort keys before comparing two API responses to spot differences quickly.
- Minified JSON suits production; formatted JSON suits config files and docs.
- To put JSON in a URL use the URL Encoder, or encode it with Base64.
🔒 Processing happens in your browser, so you can format sensitive data like config secrets without sending it to any server.
The most common JSON errors and how to fix them
Most JSON errors come from small differences with JavaScript object syntax. Watch out for:
- Trailing commas:
{"a":1,}is invalid — remove the comma after the last item. - Single quotes: keys and strings must use double quotes
"...". - Unquoted keys:
{name:"Ali"}is wrong; use{"name":"Ali"}. - Comments: standard JSON supports neither
//nor/* */. - Unsupported values:
undefined,NaNand functions aren't allowed — usenull.
Beautify or minify?
Beautifying (indentation) makes files readable while developing and debugging. Minifying strips whitespace to reduce payload size over the network in production. To encode data for safe transport, use the Base64 tool.
Frequently Asked Questions
How do I find where my JSON is broken?
The tool shows the line, column and error message and selects the offending character in the input.
Can it handle large JSON files?
Yes — multi-megabyte files process quickly on most devices.
What's the difference between format and minify?
Formatting adds whitespace for readability; minifying removes it to reduce size. The data is identical.
Can I convert JSON to Excel?
Yes. Use “JSON → CSV” and open the downloaded file in Excel.
Is my data sent to a server?
No. Everything happens in your browser.
Last updated: