JSON Key Sorter

Developer Tools

Sort JSON keys A–Z, even nested

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Order
Indent

Similar tools you may like

History

All history →

JSON Key Sorter — at a glance

Put all the keys of a JSON file in alphabetical order so it is tidy and easy to compare.

Input
{"b":1,"a":2}
Run
Result
{"a":2,"b":1}

How to use it — step by step

Valid JSON (an object or an array of objects).

1

Paste your input

Paste or type your content into the big input box.

2

Choose options

Pick the mode and options that fit what you need.

3

Sort Keys

Press the button. The result is created instantly on your device.

4

Copy the result

Check the output and press Copy to use it anywhere.

Pro tips

Small things that make the result better.

✦Sorted keys make Git diffs much smaller and cleaner.
✦Turn off nested sorting to sort only the top level.
✦Array order is never changed — only object keys.

Quick facts

Nestedsorts deeply
2 ordersA–Z and Z–A
Validatesshows JSON errors
Freeno signup

Frequently Asked Questions

Does it change my values?+

No. Only the order of keys changes. Values and array order stay exactly the same.

Why does it say Invalid JSON?+

The input is not valid JSON. Check for missing quotes, commas or brackets.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

More Free Tools