How it works
Parse JSON, recursively sort object keys in UTF-16 code-unit order, preserve array order, and format with two spaces.
Input definitions
- JSON
- Plain text; maximum 200,000 characters.
A worked example
- JSON
- {"z":1,"a":{"c":3,"b":2}}
Assumptions & limits
Maximum 10,000 nodes and depth 50. JSON numbers use JavaScript precision; duplicate keys collapse to the last value.
Sources & review
Maintained by AnsRio. Methods and examples use automated checks; this does not imply independent professional certification.
Method updated 2026-10-17. Content checked against the stated method and examples. Our verification approach.
Common questions
Does sorting keys change array order?
No. Arrays remain in their original order while objects are processed recursively. Integer-index object keys follow JavaScript’s numeric ordering; the output is not cryptographic canonical JSON.
Does this tool execute the code or data I paste?
Inputs are treated as data under the stated parser or transformation. Output is displayed as text. Parsing or formatting does not establish that the content is safe to execute elsewhere.
How does the Sort JSON object keys tool work?
Parse JSON, recursively sort object keys in UTF-16 code-unit order, preserve array order, and format with two spaces.
What are the assumptions and limits of Sort JSON object keys?
Maximum 10,000 nodes and depth 50. JSON numbers use JavaScript precision; duplicate keys collapse to the last value.