ToolHub

JSON Key Sorter

Recursively sort JSON object keys alphabetically while preserving array order—great for stable diffs and tidy config files. Everything runs in your browser.

Input
Output

FAQ

When is key sorting useful?

Sorting both sides before a diff exposes real differences instead of ordering noise—also handy for keeping config files consistent.

Why keep array order?

Object key order carries no meaning, but array order is data. Only keys inside array elements get sorted.

Does it handle JSON with comments?

Standard JSON only—strip comments and trailing commas (JSONC) first.

Related tools