Format, validate, and minify JSON data
Runs entirely in your browser. Nothing you type or upload is sent to us or stored.
Results are for general guidance. Please check anything important before relying on it. Terms of use
How to Use
- The page opens on a formatted example. Paste your raw JSON over it (valid JSON is beautified as soon as you paste), or click Open file to load a .json file. Sample brings the example back.
- It is checked as you type. If something is wrong, you'll see the line and column, the line itself with a ^ under the problem, and a plain explanation such as a missing or extra comma. Line numbers run down the left, and the line with the problem is marked. The viewer is dimmed until the JSON is valid again. If the only problems are comments or trailing commas (common in config files), click Remove comments and trailing commas to fix them in one go.
- Click Beautify (or press Ctrl+Enter) to indent it neatly. Choose 2 spaces, 4 spaces or tabs, and turn on Sort keys to order keys A to Z. Minify (Ctrl+Shift+Enter) squashes it onto one line. Stringify / unescape turns the JSON into one escaped string (to paste into code or a JSON field), or turns an escaped string such as
{\"id\":7}back into readable JSON. - Browse the data in the JSON Viewer. Expand all and Collapse all open or close every level.
- Click Copy, or Download to save a .json file. Turn on "Remember my JSON" only if you want it kept in this browser for next time.
What is JSON?
JSON (JavaScript Object Notation) is the standard format for sending data between web APIs, and it's everywhere in config files and databases too. People can read it, and every modern programming language supports it out of the box. Nearly every REST API, from payment gateways to social media, sends and receives JSON. This JSON formatter makes it readable, checks it for errors and shows it as a tree you can expand and collapse.
Where it comes in handy
- API debugging: copy a response from Postman or your browser's DevTools and format it so you can actually read it.
- Config files: tidy up package.json, appsettings.json or tsconfig.json.
- Data pipelines: validate JSON before it goes into a database or message queue.
- Log analysis: many logging systems write minified JSON. Format it to find the problem faster.
JSON syntax rules
- Keys must be strings in double quotes:
"name", notname. - A value can be a string, number, boolean, null, array or object.
- Trailing commas aren't allowed, unlike in JavaScript objects.
- Comments aren't allowed either. If you need them in config files, use a JSON5 parser.
So {'name': 'Asha',} fails twice, once for the single quotes and once for the trailing comma. The valid version is {"name": "Asha"}.