MergeJSON

Sort JSON Keys Online.

Sort JSON keys alphabetically A to Z or Z to A. Reorder nested object keys recursively, preserve arrays by default, optionally sort arrays, and export clean formatted JSON.

No signup · No uploads · Recursive key sorting

Sorted JSON output

// Sorted JSON appears here.

Sort JSON keys alphabetically

A sort JSON keys tool reorders object properties so JSON output is easier to scan, compare, review, and commit. Paste JSON above, choose A to Z or Z to A, and the tool outputs valid JSON with sorted keys. It runs entirely in your browser, so private data never leaves your device.

How to sort JSON keys in three steps

  1. Paste JSON into the input or load the sample.
  2. Choose sort options - A to Z, Z to A, recursive nested keys, and array handling.
  3. Sort and export - copy the result or download sorted JSON.

Recursive nested JSON sorting

Most real JSON has nested objects. With recursive sorting enabled, the JSON key sorter sorts keys inside every object, not just the top level. That makes API responses, package metadata, translation files, configuration files, and test fixtures more stable and easier to review in diffs.

Preserve arrays or sort arrays too

Array order often has meaning, so this tool preserves arrays by default. If you intentionally want deterministic array order, choose Sort arrays too. Objects inside arrays can still have their keys sorted recursively while the array items stay in their original order.

Why sort JSON keys?

Sorted JSON is useful when you want stable Git diffs, readable config files, normalized API examples, or deterministic generated output. You can combine this page with JSON Formatter for readable indentation, JSON Minifier for compact output, or JSON Diff to compare two normalized JSON files. Learn more in the guide on how to sort JSON keys.

FAQ

Sort JSON keys, answered.

How do I sort JSON keys online? +

Paste your JSON into the JSON Sort tool, choose A to Z or Z to A, and press Sort JSON Keys. The tool parses the JSON, reorders object keys, and outputs valid sorted JSON.

Can it sort nested JSON keys recursively? +

Yes. Recursive nested keys is enabled by default, so object keys are sorted at every level of the JSON document. You can turn it off when you only want to sort top-level keys.

Can I sort JSON keys from Z to A? +

Yes. Choose Z to A to sort keys in reverse alphabetical order. Choose A to Z for the standard alphabetical JSON key sort.

Does sorting JSON keys change values? +

No. Sorting object keys changes only the order of properties in the output. Strings, numbers, booleans, null, objects, and arrays keep their values.

Can it sort arrays inside JSON? +

Yes, but arrays are preserved by default because array order often has meaning. Choose Sort arrays too when you intentionally want array values reordered.

Is my JSON uploaded when sorting keys? +

No. Sort JSON keys runs entirely in your browser. Your data is never uploaded, stored, logged, or sent to a server.