← Back to the toolbox
JSON FORMATTER
Paste messy JSON and get it validated, pretty-printed, sorted, or minified — right here in your browser.
1
Indent
Formatted entirely in your browser with plain JavaScript — nothing is uploaded anywhere.
How to format JSON
- 1
Paste your JSON into the input box, or click "Use sample" to try it out.
- 2
Pick an indent width — 2 spaces, 4 spaces, a tab, or minify to a single line.
- 3
Optionally turn on "Sort keys" to alphabetize object keys at every level.
- 4
Copy the formatted result or download it as a .json file.
Questions
- Is my JSON uploaded anywhere?
- No. Everything is parsed and formatted locally in your browser with plain JavaScript — the data never leaves your machine.
- What happens if my JSON is invalid?
- You'll see the parse error and, when the problem can be located, a "Jump to line, column" link that moves your cursor straight to the offending character in the input.
- Can it minify JSON instead of pretty-printing it?
- Yes. Pick the "Minify" indent option to collapse the formatted output to a single line with no extra whitespace.
- Does sorting keys change the meaning of my JSON?
- No. Object key order isn't meaningful in JSON, so alphabetizing keys is purely cosmetic and safe to use on any valid document.