JSON Formatter & Validator
Format, validate, and beautify JSON data.
- Runs in your browser
- No signup
How to use JSON Formatter & Validator
Paste your JSON
Drop in minified API responses, config files or anything JSON. It is validated as you type.
Format or minify
Beautify with 2 spaces, 4 spaces or tabs, sort keys alphabetically, or minify to one line.
Fix and copy
Jump to the exact line and column of any error, explore the tree view, then copy the result.
How to format and validate JSON
JSON from APIs and logs usually arrives as one long unreadable line, and a single missing comma breaks everything. JSON Formatter & Validator pretty-prints it with syntax highlighting, pinpoints errors by line and column, and lets you explore nested data as a tree, all in your browser.
Common JSON errors and how to fix them
Most invalid JSON comes down to a handful of mistakes:
- Trailing commas after the last item in an object or array. JSON does not allow them.
- Single quotes. Keys and strings must use double quotes.
- Unquoted keys, such as {name: "Ada"} instead of {"name": "Ada"}.
- Comments. Standard JSON has no comment syntax, so remove // and /* */ lines.
- Special values like undefined or NaN, which are JavaScript, not JSON.
Formatting options
Choose 2-space, 4-space or tab indentation to match your project's style. Sort Keys orders every object's keys alphabetically, recursively, which makes two versions of the same data much easier to compare in Text Diff. Minify strips all whitespace for the smallest payload.
Safe for sensitive data
API responses often contain tokens, emails and customer records. Everything is parsed and formatted in your browser, so nothing is sent to a server or logged. To turn JSON into a spreadsheet, use JSON to CSV.