Sort JSON keys
Sort the keys of every JSON object from A to Z, at every level, and get it back formatted or minified.
Runs in your browserNothing uploadedWorks offline
Set up for this job. It runs on JSON formatter and validator, where every option is there to change.
Loading Sort JSON keysRuns on this device. Nothing is uploaded.
Questions
Are nested objects sorted too?
Yes. Keys are sorted in every object at every level. Arrays keep their order, since the order of a list is part of its meaning.
Why sort keys at all?
Sorted keys make two JSON files easy to compare and keep diffs small when files are kept in version control.
Is my JSON uploaded?
No. It is sorted in this tab. Nothing leaves your device.
Related tools
All developer toolsDeveloperjson geojson plainJSON formatter and validatorFormat, validate and minify JSON, see the exact line and column of any error, and explore it as a collapsible tree.Developerjson geojson plainJSON minifierMinify JSON by removing all whitespace, after checking that it is valid, and see the size before and after.DeveloperjsonJSON to TypeScriptTurn a JSON sample into TypeScript interfaces or types, with nested types, unions and optional keys worked out for you.Developerjson yaml ymlJSON to YAMLConvert JSON to clean, readable YAML as you type, with 2 or 4 space indents and long strings kept on one line.Developerjson yaml ymlJSON, YAML, TOML and XML converterConvert between JSON, YAML, TOML and XML in any direction as you type, with clear line and column errors.Developerjson yaml ymlXML to JSONConvert XML to JSON as you type: attributes become @ keys and repeated elements become arrays.