JSON Formatter
Format, minify and validate JSON with a precise error position, key sorting and a collapsible tree view.
JSON input
How to use the JSON formatter
- Paste JSON into the left box, drop a
.jsonfile on it, or press Sample — valid JSON is formatted the moment you paste. - Pick an indent (2 spaces, 4 spaces or a tab), optionally sort keys A→Z, or press Minify to strip every space and newline.
- Switch to the Tree tab to fold large objects, then copy or download the result.
FAQ
Where exactly is my JSON broken?
The validator is a strict JSON parser written for this page, so it reports the real line and column plus the character it tripped over — trailing commas, single quotes, comments and unescaped control characters each get their own message instead of a generic "unexpected token".
Does sorting keys change my data?
No. Object keys are reordered alphabetically at every level, which JSON treats as equivalent; values, arrays and array order are untouched. Numbers keep their original text, so big integers and trailing zeros survive a round trip.
Is my JSON uploaded anywhere?
Never. Parsing, formatting and the tree view all run in your browser, so you can safely paste API responses that contain tokens or personal data.