Sort JSON Keys

Sort the keys of every object in a JSON document alphabetically, at every level of nesting. Arrays keep their order, values stay exactly as written, and it all happens in your browser.

Add to Chrome Free: formats JSON pages right in the tab.

How to sort JSON keys

  1. Paste JSON into the editor above, drop a .json file onto it, or load it from a URL.
  2. Open the Transform menu and choose Sort Keys (A→Z).
  3. Copy or save the sorted JSON. Undo returns the original order.

Why sort keys

More JSON tools

Frequently asked questions

Is the sort case-sensitive?

No. Keys are compared without regard to case, so apple, Banana and cherry come out in that order.

Are arrays sorted too?

No. The order of array items is part of the data, so only object keys are sorted, inside arrays as well as at the top level.

Can I undo sorting?

Yes. Undo steps back to the version before sorting, and History lets you jump to any of the last 30 versions.