Real examples of field-based sorting with complex JSON arrays
{
"employees": [
{
"id": 3,
"name": "Alice Wilson",
"salary": 85000,
"department": "Engineering",
"joinDate": "2020-03-15",
"performance": {
"rating": 4.8,
"projects": 12
}
},
{
"id": 1,
"name": "Bob Smith",
"salary": 72000,
"department": "Marketing",
"joinDate": "2019-01-10",
"performance": {
"rating": 4.2,
"projects": 8
}
},
{
"id": 2,
"name": "Carol Davis",
"salary": 95000,
"department": "Engineering",
"joinDate": "2021-06-20",
"performance": {
"rating": 4.9,
"projects": 15
}
}
]
}
Sort Examples:
• Sort by salary (descending): employees.salary ↓
• Sort by name (ascending): employees.name ↑
• Sort by performance rating: employees.performance.rating ↓Organize your JSON data with intelligent sorting that understands data types and relationships
Sort JSON arrays by any field value using simple dot notation. Works with nested properties and complex objects.
Intelligent sorting for strings, numbers, dates, and boolean values with automatic type detection.
Choose between A-Z or Z-A sorting order with intuitive up/down arrows for direction control.
Sort arrays while keeping all object properties intact, maintaining data relationships perfectly.
Sort JSON object keys for clean diffs and sort arrays of objects by one or more fields, with jq, JavaScript and Python examples, sorting pitfalls and canonical JSON.
Why a plain text diff fails on JSON, how to normalize files first, how to handle arrays, and working Python and command-line examples to compare JSON structurally.
© 2026 TrueJson. All rights reserved.