JSON Toolsavailable

JSON Sort Keys

Sort JSON object keys for predictable file diffs.

JSON input

Paste strict JSON to sort object keys locally.






Sorted JSON outputRead-only

Sorted JSON will appear here.






Options

Options apply the next time you sort. Array item order and JSON values are never changed.

What this tool does

Sort JSON object keys alphabetically in your browser. Objects are sorted at every nesting level, including objects inside arrays, while values and array item order stay unchanged.

How to use

  1. Paste a complete strict JSON value into the input editor.
  2. Choose ascending or descending key order and an output format.
  3. Select Sort Keys or press Ctrl/⌘+Enter.
  4. Copy, download, or move the current output back into the input.

Privacy and limitations

Processing happens locally in your browser and nothing is uploaded or automatically saved. This tool accepts strict JSON only; comments, trailing commas, single quotes, and JavaScript object literals are not valid JSON.

Frequently asked questions

Does sorting change JSON values?

No. Strings, numbers, booleans, null, and nested values are preserved exactly as JSON values.

Will array order change?

No. Array items remain in their original order; only object keys inside them are sorted.

Are nested objects sorted?

Yes. Every object is sorted recursively, including objects nested inside arrays.

Practical guide

When to use it

Use it to make object-key order predictable before code review, snapshot comparison, or storing generated JSON in version control.

Three steps

  1. Paste one complete, valid JSON value.
  2. Choose ascending or descending key order and an output format.
  3. Sort and review the result before replacing the source file.

Example and a common mistake

Sorting a translation object puts account, billing, and profile keys in a stable order for a smaller diff.

Object keys can be reordered safely in JSON, but array items retain their original order because that order may be meaningful.

JSON

Available

JSON Formatter

Format, validate, minify, and sort JSON locally.

JSON

Available

JSON Compare

Compare two JSON documents and spot structural differences.

JSON

Available

JSON Minifier

Remove nonessential whitespace from JSON documents.