Skip to main content
Sorts the keys of an object based on the provided sort method and direction. Only the order of the fields changes; every value stays attached to its own key and nothing is added or removed. Use this when a target system expects fields in a predictable order, or simply to make your output easier to read. You can sort alphabetically up or down, or put specific keys first in an order you choose.

Fields

Sample data

FieldValue
methodAscending
Input:
{
    "address": { "zip": "1011 AB", "city": "Amsterdam", "country": "NL", "street": "Keizersgracht 1" }
}
Output:
{
    "address": { "city": "Amsterdam", "country": "NL", "street": "Keizersgracht 1", "zip": "1011 AB" }
}