Category: Developer tools
JSON Key Sorter
Recursively sort JSON object keys alphabetically
Sort the keys of every object in a JSON document alphabetically, ascending or descending, with a case-sensitive option and pretty or compact output. Runs in your browser.
{
"address": {
"city": "London",
"country": "UK"
},
"name": "Ada Lovelace",
"role": "Engineer",
"skills": [
"Analysis",
"Mathematics"
]
}Everything on this page is processed in your browser. Nothing is uploaded.
What this tool does
A JSON document copied from different tools or written by hand often has its keys in an inconsistent order, which makes two otherwise-identical objects look different in a diff. This tool walks the parsed document and rebuilds every object with its keys sorted, leaving array element order untouched by default since sorting a list of records has no natural key order; arrays of plain values can optionally be sorted too.
How to use it
- Paste your JSON into the input box, or load the example to see what changes; the document is parsed first and then every object is rebuilt level by level.
- Choose ascending or descending order and decide whether the key comparison should be case-sensitive, which separates keys starting with an uppercase letter from those starting with a lowercase one.
- Switch between pretty output for reading and reviewing diffs and compact output for pasting back into a config or a request body, then copy the sorted JSON.
Privacy
This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.
Frequently asked questions
- How do I use JSON Key Sorter?
- Paste your JSON or load the example, choose ascending or descending order and whether the comparison is case-sensitive, then pick pretty or compact output and copy the result. Sorting is recursive, so nested objects are reordered at every level.
- Which inputs and options does JSON Key Sorter support?
- The input is a JSON document. There are three options: ascending or descending order, a case-sensitive key comparison, and pretty or compact output. Array element order is preserved by default, and arrays of plain values can optionally be sorted too.
- How do I view or copy the result?
- The sorted JSON appears in the result area on the same page. Change the sort direction or the output format and the result updates, so you can check it before copying.
- Is my input, file, or result uploaded?
- No. Inputs, files, settings, and results stay in the browser and are not uploaded to LocalTools. Parsing and sorting run on your own device, so a document containing keys or internal fields never reaches a server.
- What does this tool not support?
- It sorts object keys only. Array element order is preserved by default, it does not sort by value or validate business rules, and there are no accounts, sync or cloud history, no server upload or cloud processing, and no batch features beyond what the page lists.