71 chars · 4 lines
Two-way sync · Edit either side and the other updates automatically.
71 chars · 4 lines
Two-way sync · Edit either side and the other updates automatically.
JSON key sorting guide
Paste valid JSON into the tool above to alphabetize object keys from A to Z. Sorting applies recursively to nested objects, including objects inside arrays, while values and array item order remain unchanged. Processing stays in your browser.
Every JSON object is sorted independently, starting at the root and continuing through nested objects. Objects contained in arrays are sorted as well, so the result uses a consistent property order throughout the document.
The sorter compares key text in ascending code-point order. Enabling Unicode decoding also makes literal Unicode escape sequences participate using their decoded display values.
Sorting changes object property order only. String, number, boolean, and null values are preserved, and array items remain in their original sequence because array order is part of the data model.
A predictable key order makes configuration files, API examples, fixtures, and generated payloads easier to scan. It can also reduce noisy text differences before comparing two documents whose values are otherwise equivalent.
Validation, sorting, formatting, imports, and downloads run locally in the browser, so sensitive payloads are not submitted to a sorting service.
Keys are alphabetized in the root object and nested profile object, while the roles array keeps its original order.
{
"z": 1,
"profile": {
"name": "Ada",
"active": true
},
"roles": ["editor", "admin"],
"a": 2
}{
"a": 2,
"profile": {
"active": true,
"name": "Ada"
},
"roles": [
"editor",
"admin"
],
"z": 1
}Common questions
No. The sorter changes object property order only. Parsed values and array item order remain unchanged.
Yes. Object keys are alphabetized recursively at every level, including objects stored inside arrays.
No. Array order is preserved because changing element positions could change the meaning of the data.
No. Validation, sorting, formatting, and file handling run locally in your browser.