Back to tools
Data Processingpublic tool

JSON Sorter

Sort a JSON document — alphabetically by object key, or by a value inside every array — with control over case, direction, nulls, and depth.

Mode
Object keys
Status
Sorted
Objects reordered
7
Local
100% browser

Key order changes

7 objects reordered

  • $

    was: zeta, user, team, alpha

    now: alpha, team, user, zeta

  • team[0]

    was: name, commits

    now: commits, name

  • team[1]

    was: name, commits

    now: commits, name

  • team[2]

    was: name, commits

    now: commits, name

  • team[3]

    was: name, commits

    now: commits, name

  • user

    was: name, id, handles, meta

    now: handles, id, meta, name

  • user.meta

    was: created, active, Count

    now: active, Count, created

Input

Unsorted JSON

Sorted output

Depth limit 10, 2-space indent

{
  "alpha": 2,
  "team": [
    {
      "commits": 812,
      "name": "davin"
    },
    {
      "commits": 96,
      "name": "nova"
    },
    {
      "commits": 2410,
      "name": "itzdabbzz"
    },
    {
      "commits": null,
      "name": "unranked"
    }
  ],
  "user": {
    "handles": [
      "dabz",
      "davin",
      "nova"
    ],
    "id": 201,
    "meta": {
      "active": true,
      "Count": 42,
      "created": "2011-01-01"
    },
    "name": "ItzDabbzz"
  },
  "zeta": 1
}