JSON Formatter
Pretty-print compact or broken JSON with a readable indentation.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Paste JSON and get a clean, indented document that is easy to read and review. The formatter validates the input first, reports the exact position of a syntax error, and can sort object keys alphabetically for stable diffs.
How to use it
- Paste JSON into the input panel, or press “Load example”.
- Choose the indentation and whether keys should be sorted.
- Press Format JSON, then copy or download the result.
Example
Input
{"site":"Tooldeck","nested":{"ok":true},"items":[1,2,3]}
Output
{
"items": [
1,
2,
3
],
"nested": {
"ok": true
},
"site": "Tooldeck"
}
Frequently asked questions
Why does my JSON fail to parse?
Trailing commas, single quotes and unquoted keys are JavaScript, not JSON. The error message names the line and column of the first problem so you can fix it quickly.
Does formatting change my data?
No. Values, numbers and key order are preserved unless you enable key sorting. Only whitespace is rewritten.
Keep going
Related tools
JSON Validator
Check JSON syntax and see exactly where it breaks.
JSON Minifier
Strip whitespace from JSON to shrink payloads.
JSON to CSV Converter
Turn an array of JSON objects into a spreadsheet-ready CSV.
YAML to JSON Converter
Convert a YAML document into JSON.
CSV to JSON Converter
Convert CSV rows into structured JSON, with type detection.
XML Formatter
Indent XML documents while preserving their content.