JSON

JSON Sort Keys

เรียงคีย์ของอ็อบเจกต์ใน JSON ตามตัวอักษรแบบเรียกซ้ำ — ลำดับอิลิเมนต์ในอาร์เรย์ไม่เปลี่ยน มีเพียงคีย์ของอ็อบเจกต์ในแต่ละระดับที่ถูกเรียง

คำถามที่พบบ่อย

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.