How to use
- Paste your JSON.
- Click Format to make it readable, or Minify to remove all spaces.
- If the JSON is invalid, the error message shows where the problem is.
- Click Copy to copy the result.
How it works
The JSON is parsed with the browser's standard JSON parser and written back with the indent you choose. Sorting keys applies to every object, including nested ones.
Tips and common uses
Mistakes that break JSON
The most common errors are a trailing comma after the last item, single quotes instead of double quotes, and keys without quotes. The error message points to the place to fix.
Sort keys to compare
Turn on "Sort keys A → Z" before comparing two JSON files. With the keys in the same order, a text diff shows only the real differences.
Format to read, minify to ship
Use the formatted version while you debug an API response, and the minified version when you need a compact string for a request, a config value or storage.
Frequently asked questions
What are the most common JSON errors?
A comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. JSON allows none of these.
Is my JSON sent to a server?
No. Formatting happens in your browser, so it is safe for API keys and private data.
Can it handle large files?
Yes, several megabytes of JSON work fine on most computers.