Skip to main content

JSON Key Sorter

Sort the keys of a JSON document A to Z, in reverse, naturally or in your own order, at every level. Private, in your browser.

More options

JSON

Stays in your browser

Sorted JSON

The result appears here after you press Convert.

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to JSON Beautifier or JSON Compare.

Free Online JSON Key Sorter

Paste JSON and get every object with its keys in order. Useful for clean diffs, config files and comparing two documents. It gives developers a quick browser-based way to solve a focused json key sorter task before moving the result into a project.

How to use JSON Key Sorter

Paste your code in the box on the left, or open a file, then press Sort. Choose the order. Put keys such as id and name first with "Keys to put first". Arrays stay as they are unless you ask to sort them.

Common mistakes

  • Sorting arrays when their order matters, such as steps or rankings.
  • Expecting comments to survive: JSON has none, and this tool reads strict JSON.

Frequently asked questions

Are big numbers changed?
No. Numbers are kept exactly as you wrote them, even above 9,007,199,254,740,991 where most tools lose digits.
Does sorting change what the JSON means?
No. The order of keys in an object has no meaning in JSON. Arrays are different, so they are only sorted when you ask.
What is natural order?
Numbers inside names are compared as numbers, so item2 comes before item10.
Is my code uploaded anywhere?
No. The conversion runs in your browser and nothing you paste is sent to a server.
How do I use this json key sorter tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Data Generation & Utilities

View all Data Generation & Utilities tools →