Readable JSON in seconds
API responses, config files and log lines often arrive as one long line of JSON. Paste it here and the formatter pretty prints it with consistent indentation, so nested objects and arrays are easy to scan. You can choose 2 spaces, 4 spaces or tabs, minify it back to a single line for production, or sort keys alphabetically to compare two payloads.
If the JSON is invalid, you get the exact line and column of the problem with the offending line highlighted. Many errors come from JavaScript habits — trailing commas, single quotes, comments or unquoted keys — and the Fix common mistakes button repairs those automatically. Everything runs in your browser, so tokens and customer data in your JSON never leave your computer.
How to format JSON
- 1
Paste or open your JSON
Paste text, drop in a .json file or load the example.
- 2
Pick the output style
Indent with 2 spaces, 4 spaces or tabs, or minify.
- 3
Fix any errors
Jump to the reported line, or let the auto-fix repair common mistakes.
- 4
Copy or download
Copy the result or save it as a .json file.
Key features
Beautify or minify
Switch between readable and compact JSON instantly.
Precise error messages
Line, column and a caret under the problem character.
One-click repairs
Removes trailing commas and comments, converts single quotes and quotes bare keys.
Sort keys
Alphabetical keys at every level make diffs cleaner.
Common uses
- Debugging APIs: Make a REST or GraphQL response readable before hunting for a field.
- Editing config files: Tidy package.json, tsconfig.json or app settings before committing.
- Code reviews: Sorted, consistently indented JSON produces smaller, clearer diffs.
Tips and good to know
- Only need a yes-or-no answer? The JSON Validator focuses on errors and structure.
- For deeply nested API responses, the API Response Formatter adds a collapsible tree and copies the path to any field.
- Need a spreadsheet instead? Convert arrays of objects with the JSON to CSV Converter.
