Beautify, minify and validate JSON, see the exact error line, fix common mistakes and browse it as a tree.
Last updated:
Your data never leaves the browser, so it is safe for API keys, tokens and private payloads.
| Feature | What it does | Also searched as |
|---|---|---|
| Format / Beautify | Adds line breaks and indentation | json pretty print, json beautifier, prettify json |
| Minify | Removes spaces to make JSON smallest | json minifier, compact json, json one line |
| Validate | Checks syntax and shows the error line | json validator, json lint, json checker |
| Tree view | Browse nested objects and arrays | json viewer, json explorer, json tree |
| Fix errors | Repairs common mistakes | fix invalid json, json repair |
| Error | Example | Fix |
|---|---|---|
| Trailing comma | {"a":1,} | Remove the last comma |
| Single quotes | {'a':'b'} | Use double quotes only |
| Unquoted key | {a:1} | Wrap keys in double quotes |
| Comments | // note | JSON has no comments - remove them |
| Python values | True, None | Use true, false, null |
| Missing comma | {"a":1 "b":2} | Add a comma between pairs |
| Unexpected end | {"a":[1,2} | Close every [ and { |
| Language / tool | Command |
|---|---|
| JavaScript | JSON.stringify(obj, null, 2) |
| Python | json.dumps(obj, indent=2) |
| Command line (Python) | python -m json.tool file.json |
| jq | jq . file.json |
| VS Code | Shift + Alt + F (Format Document) |
| PHP | json_encode($obj, JSON_PRETTY_PRINT) |
| Format | Best for |
|---|---|
| JSON | APIs, web apps, config |
| XML | Older enterprise systems, SOAP, RSS |
| YAML | Human-edited config (Docker, Kubernetes) |
| CSV | Spreadsheets and flat tables |
| Where | How |
|---|---|
| Chrome / Edge DevTools | Network tab → click the request → Preview (tree) or Response |
| Firefox | Opens .json URLs in a built-in JSON viewer |
| Postman / Insomnia | Body → Pretty |
| Notepad++ | JSON Viewer plugin → Format JSON |
| Sublime Text | Pretty JSON package → Ctrl+Alt+J |
| IntelliJ / WebStorm | Ctrl+Alt+L (Reformat Code) |
| Type | Example | Note |
|---|---|---|
| String | "Prajwal" | Double quotes only |
| Number | 42, 3.14, -1e5 | No leading zeros, no NaN or Infinity |
| Boolean | true, false | Lowercase |
| Null | null | Lowercase, not None or undefined |
| Object | {"a": 1} | Keys are strings |
| Array | [1, "two", null] | Mixed types allowed |
Paste the JSON above and press Format / Beautify. Choose 2 spaces, 4 spaces or tabs for indentation.
Press Validate. Valid JSON shows a green tick; invalid JSON shows the error with its line and column, and the line is highlighted.
Press Fix errors. It removes trailing commas and comments, converts single quotes, quotes bare keys and changes True/False/None to JSON values.
Beautify adds indentation for reading; minify removes all whitespace to make the file as small as possible for sending.
Yes. Formatting happens in your browser; nothing is uploaded or stored.
Yes. Format it and switch to Tree view to expand and collapse objects and arrays.
The JSON standard (RFC 8259) has no comment syntax. Remove comments or use JSON5/JSONC where your tool supports it.
Several megabytes work smoothly in a modern browser. Very large files depend on your device memory.