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이 정렬을 위해 서버로 전송되나요?
아닙니다. 정렬은 모두 브라우저의 자바스크립트에서 이루어집니다.
모든 중첩 단계에서 키가 재귀적으로 정렬되나요?
네, 정렬은 최상위 키뿐 아니라 모든 깊이의 중첩 객체 키에도 동일하게 적용됩니다 — 그렇지 않으면 결과가 일관성이 없어집니다.
언어나 로케일이 정렬된 키의 순서에 영향을 주나요?
Unicode 코드 포인트 기준의 바이트 정렬은 알파벳과 무관하게 모든 대문자를 소문자보다 앞에 놓습니다. 이는 언어 규칙을 고려해 "사람이 보기에 자연스럽게" 정렬하는 로케일 인식 정렬과는 다릅니다 — 대부분의 기술적인 키에서는 차이가 눈에 띄지 않지만, 비라틴 문자 이름에서는 유의해야 합니다.