JSON
JSON Sort Keys
JSON のオブジェクトキーを再帰的にアルファベット順にソート — 配列要素の順序は変わらず、各ネストレベルのオブジェクトキーのみソートされます。
JSON doesn't guarantee object key order, so two semantically identical documents can look different simply because their fields are in a different order. This tool recursively sorts object keys alphabetically at every nesting level, without touching array element order.
How to use it
- Paste JSON and its object keys are sorted alphabetically instantly, at every level of nesting.
- Pick ascending or descending order as needed.
- Array element order is left untouched — only object keys are sorted, not array values.
Common uses
- Bringing JSON into a canonical form before comparing it with git diff or a text diff tool.
- Normalizing a configuration file for a stable, predictable look in a repository.
- Preparing JSON before computing a content hash, when the result needs to be deterministic regardless of input field order.
Things to keep in mind
Sorting is byte-based (by Unicode code point) — all uppercase letters come before lowercase ones regardless of alphabet, unlike locale-aware sorting.
Only object keys are sorted — array element order carries semantic meaning in JSON, so it's never changed.
よくある質問
このJSONソートツールは何をしますか?
JSON内のすべてのオブジェクトのキーを、ネストのすべての階層で再帰的にアルファベット順(昇順または降順)に並べ替えます。
配列の要素の順序も並べ替えられますか?
いいえ、並べ替えられるのはオブジェクトのキーのみです。配列は位置によって順序が決まるため、要素の順序はそのまま維持されます。
入力したJSONはサーバーに送信されて処理されますか?
されません。並べ替えはすべてブラウザ内のJavaScriptで行われます。
キーはネストのすべての階層で再帰的にソートされますか?
はい、ソートはトップレベルのキーだけでなく、任意の深さにあるすべてのネストしたオブジェクトのキーにも適用されます — そうしないと結果に一貫性がなくなってしまいます。
言語やロケールはソートされたキーの順序に影響しますか?
バイト単位のソート(Unicodeコードポイントによる比較)は、アルファベットに関係なくすべての大文字を小文字より前に並べます。これは言語の規則を考慮したソート(「人間らしい」順序)とは異なります — 多くの技術的なキーでは違いはほとんど分かりませんが、非ラテン文字の名前では注意が必要です。