Sort JSON Without Uploading

Put a JSON document in a stable order. You can sort object keys alphabetically, or sort array values (and, with a key name, arrays of objects by that field), in ascending or descending order. JSON Lines is written back as one compact value per line; ordinary JSON is pretty-printed with two-space indent.

This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.

How to sort

1. Paste JSON. 2. Choose mode: “key” to sort object keys, or “value” to sort arrays. 3. If you are sorting objects in an array, type the property name to sort by. 4. Pick ascending (default) or descending.

Sorting `{ "b": 1, "a": 2 }` by key in ascending order yields `{ "a": 2, "b": 1 }`.

Privacy and format

Sorting runs in the browser. Invalid JSON is rejected with an error. Nested objects have their keys sorted as the tool walks the value, so the whole document comes out in a predictable order.

Frequently asked questions

Does this sort numbers correctly in an array?

Array values are sorted according to the tool’s value mode. For arrays of objects, set the key to the field you want to compare.

Is my JSON uploaded?

No.

Will JSONL stay JSONL?

Yes. Each line is written as compact JSON, one value per line.

Is key sorting case-sensitive?

Keys are compared with locale-aware string comparison. Letter case can affect the order.

More JSON Tools