JSON Sorter

Sort JSON object keys alphabetically at every level, and sort arrays of values or objects by any field.

Paste or type JSON above to sort it.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Paste JSON and every object in the document is rebuilt with its keys in alphabetical order, at every nesting level, as you type. Choose A → Z or Z → A, and pick natural ordering (so item2 comes before item10 and case is ignored) or strict code-point ordering. Tick Sort array values to also order arrays of strings and numbers, or type a field name to sort arrays of objects by that property — handy for turning an unordered API response into a stable, diff-friendly file.

Sorting runs entirely in your browser with the native JSON.parse and JSON.stringify functions — nothing is uploaded, so it is safe for API responses, translation files, config and lock files. Invalid JSON is reported with the exact line and column, and the result can be copied or downloaded as a .json file with 2-space, 4-space, tab or minified output.

Frequently asked questions

How do I sort JSON keys alphabetically online?

Paste your JSON into the box and every object is rebuilt with its keys in alphabetical order, at every nesting level, as you type. Switch between A → Z and Z → A, pick 2-space, 4-space, tab or minified output, then use Copy JSON or Download .json to keep the result.

Can it sort JSON arrays as well as object keys?

Yes. Tick "Sort array values" and arrays of strings, numbers or booleans are ordered too. To sort an array of objects, type the property name in the "Sort arrays of objects by field" box — for example name or id — and each matching array is ordered by that field. Arrays it cannot order safely are left untouched and reported below the output.

Why sort JSON at all, and is my data uploaded?

A consistent key order makes two payloads easy to compare and keeps git diffs small for config, lock and translation files. Nothing is uploaded: sorting runs entirely in your browser with the native JSON parser, so API responses, tokens and private config never leave your device — unlike many online JSON tools that process your payload on their server.

Report a bug