JSON formatter and validator
API responses and config files often arrive as one long, unreadable line. Paste them here and this JSON formatter instantly beautifies them with clean indentation — or minifiesthem to a single compact line. It also validates the JSON as you type and, if something is wrong, points to the exact line and column with a plain-English explanation such as “trailing comma” or “strings must use double quotes”. Sort keys alphabetically to make documents easy to compare.
How to use it
- Paste your JSON in the top box.
- Choose 2 spaces, 4 spaces, tabs or minify; optionally sort keys.
- Fix any error shown, then copy or download the result.
Example
{"a":1,"b":[2,3],} is invalid because of the trailing comma before the closing brace — the validator says so and shows where. Remove it and the formatter lays it out over several readable lines. Convert JSON arrays to a spreadsheet with JSON to CSV, or compare two JSON files withtext compare.