What is JSON Formatter?
Indent JSON that's crammed onto one line — like an API response or config file — so it's easy to read, or strip the whitespace to make it smaller. If there's a syntax error, you'll see the line and column. Everything runs in your browser, so it's safe for sensitive data.
How to use
- 1
Paste a JSON string into the input box.
- 2
Press “Format” to indent it with your chosen style (2 spaces, 4 spaces, or tab).
- 3
Press “Minify” to get single-line JSON with whitespace and line breaks removed.
- 4
If there's an error, check the message and position and fix it.
Use cases
Debugging API responses
Paste a response body copied from DevTools to understand its structure quickly.
Validating config files
After editing package.json or tsconfig.json, catch mistakes like a missing comma.
Comparing with sorted keys
Use “Sort keys” to normalize key order in two JSON files, then compare them with the text compare tool.
FAQ
Is my JSON sent to a server?+
No. Parsing and formatting all happen in JavaScript in your browser.
Does JSON with comments work?+
Standard JSON doesn't allow comments, so they're reported as errors. Remove the comments first.