Sort JSON Keys

Sort JSON Keys lets you recursively alphabetize object keys while keeping array order unchanged. Enter your own values or load the worked example.

Method and calculation

Recursively alphabetize object keys while keeping array order unchanged.

Inputs and settings

Sort JSON Keys accepts JSON.

Worked example

Sort JSON Keys example — JSON: "{\"z\":1,\"a\":{\"d\":2,\"b\":3}}". Computed output: { "a": { "b": 3, "d": 2 }, "z": 1 }

Output and limitations

Sort JSON Keys: Input is treated as plain text; it is never executed.

Technical references: RFC 8259 JSON format

Sort JSON Keys FAQs

Sort JSON Keys applies the following rule to your input: Recursively alphabetize object keys while keeping array order unchanged. The worked example on this page uses the same processor as the result button.
Sort JSON Keys has these boundaries: Input is treated as plain text; it is never executed. Start by checking the json field against the units or format shown.
Sort JSON Keys provides this sample: { "a": { "b": 3, "d": 2 }, "z": 1 }. Use the sample button to reproduce it, then replace the inputs with your own values.