JSON Sorter

Sort the keys of a JSON object alphabetically, recursively, in your browser.

Suggested tools

JSON Formatter

Beautify, minify and validate JSON instantly in your browser.

JSON
Open Tool

JSON to XML

Convert JSON into well-formed XML.

JSONXML
Open Tool

XML to JSON

Convert XML into clean JSON.

XMLJSON
Open Tool

JSON to YAML

Convert JSON into readable YAML.

JSONYAML
Open Tool

YAML to JSON

Convert YAML into JSON.

YAMLJSON
Open Tool

JSON Escape / Unescape

Turn text, JSON or XML into a JSON string literal, or unescape it back.

JSONTEXT
Open Tool

About JSON Sorter

JSON Sorter orders the keys of every object alphabetically, at every level of nesting, and formats the result neatly. Sorted JSON is much easier to compare, review in pull requests and keep consistent across config files and translation files.

Arrays keep their original order — only object keys are sorted — so the meaning of your data never changes. Numbers are kept exactly as written. Everything runs locally in your browser — the text you paste is never uploaded.

How to use JSON Sorter

  1. Paste your JSON or upload a .json file.
  2. Press Convert to sort the keys.
  3. Copy or download the sorted JSON.

Key features

  • Sorts keys recursively, at every depth
  • Array order preserved
  • Validates first, with line and column on errors
  • Exact number formatting kept

Example

Keys are sorted at every level; the array keeps its order.

Input
{"zeta":1,"alpha":{"b":2,"a":1},"list":[3,1,2]}
Output
{
  "alpha": {
    "a": 1,
    "b": 2
  },
  "list": [
    3,
    1,
    2
  ],
  "zeta": 1
}

When to use JSON Sorter

  • Making two JSON files comparable before using JSON Compare or a Git diff.
  • Keeping translation and config files in a predictable order.
  • Reducing merge conflicts in files edited by several people.

Tips and common problems

  • Sorting is case-sensitive: uppercase keys come before lowercase ones.
  • Array order is never changed, because it can carry meaning.
  • Sort both files the same way before comparing them.

Frequently asked questions

When two files have the same keys in a different order, diffs show changes that are not real. Sorting both first makes JSON Compare and Git diffs show only genuine differences.