JSON Formatter & Validator
Check, format, and fix JSON in your browser. Nothing is uploaded.
How to format JSON
- Paste your JSON above, or choose Open file to load a
.jsonfile. - Choose Format, with 2 spaces, 4 spaces, or tabs for each level.
- Copy or download the result.
Formatting, also called pretty-printing or beautifying, only changes spaces and line breaks. Keys, values, and their order stay exactly as they were. If the JSON has a mistake, the editor underlines the line, and Fix My JSON can repair common ones. For the rules behind it all, read the JSON format guide.
Formatting JSON in code
// JavaScript
JSON.stringify(data, null, 2)
# Python
json.dumps(data, indent=2)
# Command line
python3 -m json.tool data.json
jq . data.json