Sort JSON Keys
Sort every object key A to Z (nested too).
Also called: JSON key sorter.
Sort JSON Keys
Sort every object key A to Z (nested too).
Watch: how to use the Sort JSON Keys (12 seconds)
Recorded on a phone, steps written on screen, no sound.
About the Sort JSON Keys
Sort every object key A to Z, including nested objects, so two JSON files are easy to compare and diffs stay clean. Arrays keep their order.
How sorting works
Keys are put in order at every level, including objects inside lists; the order of list items is not changed. Sorting follows character codes, so capital letters come before small letters: B comes before a.
Sorted keys make two JSON files easy to compare line by line and keep settings files tidy in Git. The values are not changed, and the result is indented with two spaces.
How to use the Sort JSON Keys
- Enter your textType or paste JSON.
- Press Run toolThe result appears right under the button.
- Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.
This tool works inside your browser: what you enter stays on your device.
Example
A sample input and the result the Sort JSON Keys gives for it (produced by the tool itself, not typed by hand).
- JSON
- {"name": "Kitwise", "tools": 3, "tags": ["pdf", "image", "text"], "free": true}
Result:
{
"free": true,
"name": "Kitwise",
"tags": [
"pdf",
"image",
"text"
],
"tools": 3
}Good to know
- What you need
- You type or choose: JSON
- Where it runs
- In your browser, on your device.
- Cost
- Free, no sign-up.
Questions
Does it change values?
No, only the key order.
How do I compare two JSON files?
Sort both, then use Text Compare.