JSON

JSON Sort Keys

Sắp xếp đệ quy các khóa của đối tượng trong JSON theo bảng chữ cái — thứ tự các phần tử mảng không đổi, chỉ khóa của đối tượng ở mỗi cấp lồng nhau được sắp xếp.

Câu hỏi thường gặp

Why would I sort JSON keys?

Sorted keys make it easier to diff two versions of a JSON document and make configuration files or API responses more predictable when browsing them.

Does this change the order of array elements?

No. Only object keys are sorted at every nesting level — array element order is left exactly as it was in the input, since arrays are ordered by position, not by keys.

Is the data processed on a server?

No, sorting happens entirely in your browser via JavaScript, with nothing sent anywhere else.