Learn how alphabetical and numerical sorting differ, including why '10' can sort before '2' in plain text order.
Sorting a list of text alphabetically seems straightforward, until numbers are involved, at which point alphabetical (lexicographic) order and numerical order can disagree in a way that surprises a lot of people the first time they see it.
Standard alphabetical sorting compares text character by character, the same way words are ordered in a dictionary.
Sorting the list [“10”, “2”, “1”] alphabetically (as text) gives: 1, 10, 2
Sorting the same list numerically gives: 1, 2, 10
Alphabetical sorting compares the first character first, “1” comes before “2” regardless of what follows it, so “10” sorts before “2” simply because its first digit is smaller. Numerical sorting instead compares the actual numeric value, giving the more intuitive order.
Depending on the sorting method, uppercase and lowercase letters can sort differently, some methods treat “Apple” and “apple” as equivalent for ordering purposes, while others sort all uppercase letters before all lowercase ones (or vice versa) based on their underlying character codes.
The Text Sorter sorts text alphabetically or numerically instantly, with options for order and case sensitivity.
Text Sorter
Because alphabetical sorting compares the first character first; “1” is a smaller character than “2”, so anything starting with “1” sorts earlier, regardless of what digits follow.
Use numeric sorting specifically, rather than alphabetical (text-based) sorting, so values are compared by their actual numeric value instead of character by character.
It depends on the sorting method; some treat uppercase and lowercase as equivalent, while others sort based on underlying character codes, which can place all-uppercase entries differently than expected.
No, sorting only reorders the list; removing duplicates requires a separate step.
Yes, most sorting tools support both ascending and descending order.
Find the right tool, or keep reading Brekzy's other guides.