JSON Sorter

Skip to editor
Explorer
Open Files

No files open

0 files open

jsoneditor.io v2

{
  "version": "1.4.0",
  "name": "my-app",
  "scripts": {
    "test": "jest",
    "build": "next build",
    "dev": "next dev"
  },
  "private": true,
  "engines": {
    "node": ">=20"
  },
  "dependencies": {
    "zustand": "^5.0.8",
    "react": "19.2.0",
    "next": "^16.1.6"
  }
}
JSONUTF-8
Spaces: 2

How do I sort JSON keys alphabetically?

To sort JSON keys, paste your JSON above, open Convert and press Sort keys. Every object is sorted alphabetically, nested ones included, and the result is formatted.

Arrays keep their order, because the order of items usually means something. Sorting both versions before you compare them is the quickest way to get a clean diff when two tools write the same keys in a different order.

  1. Paste your JSON into the editor.
  2. Open Convert and press Sort keys.
  3. Copy the sorted result.

Example

JSON
{
  "version": "1.4.0",
  "name": "my-app",
  "scripts": {
    "test": "jest",
    "build": "next build",
    "dev": "next dev"
  },
  "private": true,
  "engines": {
    "node": ">=20"
  },
  "dependencies": {
    "zustand": "^5.0.8",
    "react": "19.2.0",
    "next": "^16.1.6"
  }
}
Sorted
{
  "dependencies": {
    "next": "^16.1.6",
    "react": "19.2.0",
    "zustand": "^5.0.8"
  },
  "engines": {
    "node": ">=20"
  },
  "name": "my-app",
  "private": true,
  "scripts": {
    "build": "next build",
    "dev": "next dev",
    "test": "jest"
  },
  "version": "1.4.0"
}

Questions people ask

Does sorting change my data?

No, JSON objects have no meaningful key order, so the data is identical. Only the order you read it in changes.

Are uppercase keys sorted before lowercase ones?

Yes, keys are compared by character code, so Zebra comes before apple. That keeps the order identical on every machine and locale.

Is my data uploaded anywhere?

No, this runs entirely in your browser, so nothing you paste is sent to a server. The only feature that sends data anywhere is the optional AI assistant, and only when you actually ask it something.