Input Array
Sort Configuration
Sorted Array
Sorted array will appear here
Enter an array and click Sort, Shuffle, or Reverse
About This Tool
JavaScript arrays can be sorted using Array.prototype.sort() with a custom compare function. This tool provides advanced sorting options for different data types including strings, numbers, booleans, objects, and nested arrays.
Key Features:
- Auto-detect: Automatically identifies array type (string, number, boolean, object, array)
- Object sorting: Sort by any property, including nested keys (e.g., user.address.city)
- Array sorting: Sort arrays within arrays by specific index
- Locale-aware: Uses Intl.Collator for proper international string sorting
- Null handling: Control where null/undefined values appear in sorted results
- Remove duplicates: Optionally filter out duplicate entries
- Custom comparators: Write your own sorting logic for complex scenarios
How to Use
1. Enter your array in the Input Array field (JSON format or comma/newline separated) 2. Configure sort settings: Select data type, sort order, and null handling 3. For objects, choose which property to sort by 4. Enable additional options like case sensitivity or remove duplicates 5. Click 'Sort Array' to see the sorted result 6. Use 'Shuffle' or 'Reverse' for alternative arrangements 7. Copy or download the sorted array for use in your projects
Common Use Cases
Limitations & Important Notes
- Large arrays (>10,000 items) may take longer to process
- Custom comparator requires valid JavaScript function syntax
- Object sorting requires consistent property structure across all items
- Browser memory limits may affect very large datasets