
Developers can use this while debugging or preparing data for an exchange, especially when the result needs a quick visual check. Sort the keys of a JSON recursively.
Sort the keys of a JSON recursively. The result appears instantly in your browser, ready to copy, with no account, upload or storage involved.
You have a JSON with keys out of order, for example {"z": 1, "a": {"y": 2, "b": 3}}. After sorting, keys appear in alphabetical order at every level. This makes reading and comparing two files much easier.
Input
{"z": 1, "a": {"y": 2, "b": 3}}Output
{
"a": {
"b": 3,
"y": 2
},
"z": 1
}Everything runs in your browser: the sort is performed locally without sending your data out. You can therefore handle configuration snippets or API responses with peace of mind.
Alphabetical sorting usually orders uppercase and lowercase according to character codes. For example, a key starting with an uppercase letter may appear before a lowercase key. Check the result if case matters to you.
Yes, sorting applies recursively to all objects, including those inside arrays. Array elements keep their order, but the keys of objects they contain are sorted.
It sorts the keys and then removes spaces and line breaks to produce compact JSON. The result is harder for humans to read, but useful for reducing size before a transfer.