About this tool
JSON (JavaScript Object Notation) is the most widely used format for exchanging data between programs – in REST APIs, configuration files and logs. Machines often produce JSON as a single, barely readable line.
This formatter turns JSON into a clear, indented layout, validates the syntax and reports errors with line and column. It also minifies JSON to save space. Optionally, all keys are sorted alphabetically – handy before comparing two JSON documents with the Text Compare (Diff) tool.
Processing happens entirely in your browser. Even confidential API responses never leave your device.
How it works
- Paste your JSON into the input field.
- The tool checks it instantly and shows “Valid JSON” or the error with its position.
- Choose “Format” with the indentation you want (2 or 4 spaces, or tab) or “Minify”.
- Copy the result or download it as a .json file.
Frequently asked questions
Why is my JSON invalid even though it works in JavaScript?
JSON is stricter than JavaScript: keys and strings need double quotes, trailing commas are forbidden and comments are not allowed. Values like undefined or NaN do not exist in JSON either.
Does sorting the keys change my data?
No. The order of keys in JSON objects has no meaning. The order of elements in arrays stays unchanged when sorting.
Can I convert JSON to YAML or CSV?
Yes, use the JSON ↔ YAML ↔ CSV ↔ TOON Converter. It converts between JSON, YAML and CSV in every direction.
Is there a size limit?
There is no fixed limit. Since everything runs in your browser, the limit depends on your device’s memory. Files of several megabytes are usually fine.