๐Ÿ”ค

Sort Lines Alphabetically

Sort text lines in alphabetical order (A-Z or Z-A).

Total Lines: 0
Sort Order: -

Common Uses

  • Contact Lists: Sort names or email addresses alphabetically
  • Glossaries: Alphabetize term definitions
  • Menus: Organize menu items in alphabetical order
  • Keywords: Sort SEO keywords for better organization
  • Bibliography: Alphabetize reference lists and citations

โ“ Frequently Asked Questions

Sorting directions: A-Z (Ascending): Alphabetical order from beginning to end. Example: Apple, Banana, Cherry, Date. Numbers: 1, 2, 3, 10, 100. Z-A (Descending/Reverse): Reverse alphabetical order. Example: Date, Cherry, Banana, Apple. Numbers: 100, 10, 3, 2, 1. Use cases: A-Z: Contact lists, indexes, glossaries, menus. Z-A: High-to-low rankings, reverse chronology (if using dates), finding last entries!
Case-sensitive vs case-insensitive: Case-sensitive: Capital letters come BEFORE lowercase (ASCII order). Example: A, B, Z, a, b, z (capitals first!). Numbers: 0-9, A-Z, a-z. Case-insensitive (default): Treats 'A' and 'a' as same. Example: a, A, b, B, z, Z (ignores case). When to use case-sensitive: Programming (variable names), file systems (Linux case-sensitive paths), product codes. When to use case-insensitive: Names, keywords, general text (most common use). Pro tip: Use case-insensitive for natural language!
Number sorting behavior: Alphabetical (string) sort: Treats numbers as text โ€” '10' comes BEFORE '2' (compares character-by-character: '1' < '2'). Example: 1, 10, 100, 2, 20, 200, 3 (wrong for numbers!). Numeric sort: Treats as numbers โ€” compares values. Example: 1, 2, 3, 10, 20, 100, 200 (correct!). This tool: Alphabetical (string) sort by default. Workaround: Pad numbers with zeros: 001, 002, 010, 100 (sorts correctly alphabetically). Mixed text & numbers: 'Item 1' vs 'Item 10' โ€” pad: 'Item 001', 'Item 010'!
Blank line behavior: Most sorters (including this tool): 1) Empty lines removed (filtered out before sort), 2) Whitespace-only lines removed (lines with just spaces/tabs). Some advanced tools: Keep blank lines at top (empty string '' sorts before 'A'), Keep blank lines at bottom, Preserve blank line positions (don't sort them). Pro tip: If you need to preserve blank lines, replace them with a placeholder (like '___BLANK___') before sorting, then replace back after!
Combined operations: Yes - common workflow: 1) Sort alphabetically (groups duplicates together), 2) Remove consecutive duplicates (easy to spot when sorted). Example: Input: 'banana, apple, banana, cherry, apple' โ†’ Step 1 (sort): 'apple, apple, banana, banana, cherry' โ†’ Step 2 (dedupe): 'apple, banana, cherry'. Tools that do both: Unix 'sort | uniq', Excel 'Remove Duplicates' (auto-sorts). This tool: Sorting only. Workflow: Use this tool to sort, then use 'Remove Duplicate Lines' tool for deduplication!