How alphabetical sorting works
Lines are compared letter by letter using the sorting rules of your browser language. That means accented letters such as é and ö sit next to their plain forms, instead of being pushed to the end as they would be in a raw character-code sort.
Case and accents
By default case is ignored, so Apple, apple and APPLE sort together. Tick Case sensitive to separate them, with the capital form first, so A comes before a. Tick Ignore accents if you want café and cafe treated as the same word.
Sort by the first or last word
Sometimes the whole line is not the right key. Choose Last word to sort a list of full names by surname, or First word to group lines by a leading keyword. Lines with the same key keep a sensible order by comparing the whole line next.
Example
The names Maria Lopez, anna Smith, John Adams, Zoe Baker, Ben carter and Ali Hassan sorted by last word become John Adams, Zoe Baker, Ben carter, Ali Hassan, Maria Lopez, anna Smith.
Where it helps
Sort a bibliography, a glossary, a list of names, keywords, tags, product names, CSS properties or import statements. Remove duplicates at the same time to tidy long lists.
For other methods use the main sort lines tool, or go the other way with reverse order. See the guide for command line and spreadsheet methods.