JSON Tool FAQ
How do I validate JSON?
Paste JSON into the input box and click Validate. The parser checks the content directly in your browser.
Can I minify large JSON payloads?
Yes. Click Minify to remove extra whitespace and reduce payload size for transport or storage.
What does optimize/compress do?
It minifies JSON and reports how many characters were removed compared with pretty-printed output.
Does this tool send data to a server?
No. Formatting, validation, and minification are performed client-side only.
Example input/output
Input: {"z":"last","a":"first","m":"middle"}
Output: {"a":"first","m":"middle","z":"last"}
How it works
This tool parses the JSON, then recursively rebuilds the object by sorting each level's keys alphabetically using Array.sort(). The sorted object is then re-serialised with JSON.stringify for display. Processing runs in your browser.
Common use cases
- Normalise JSON key order for consistent diff output in code reviews
- Sort JSON keys alphabetically before committing configuration to version control
- Produce deterministic JSON output from API responses for snapshot testing