100% Client-Side WASMZero Remote NetworkVerified Spec

Sort Lines

Interactive Studio

Sort the lines of your text alphabetically, ascending or descending. Instant feedback with zero server storage.

Loading tool…

About Sort Lines

This tool splits your text on line breaks and reorders the resulting lines alphabetically, either A-to-Z or Z-to-A. Sorting compares lines as strings from left to right, which means it follows character code order rather than a dictionary's sense of alphabetization — numbers sort before uppercase letters, which sort before lowercase letters in standard ASCII-based comparison, so "Zebra" can end up sorted before "apple" if case isn't normalized first, and "10" sorts before "9" because it compares the first character ("1" vs "9") rather than the numeric value.

Line-based sorting is distinct from sorting words within a sentence — each full line, however long, is treated as a single unit to compare against every other line, so this works cleanly on lists (one item per line) but would just reorder whole sentences if applied to prose broken across multiple lines.

Common uses include alphabetizing a list of names or file paths, organizing a glossary or reference list into A-Z order, or reversing a list that's already sorted one way when you need the opposite order for a different display.

How to use Sort Lines

  1. Paste your lines.
  2. Choose A to Z or Z to A.
  3. Copy the sorted list.

Worked examples

Input: pear Apple banana 10 2

Result: Ascending: 10, 2, Apple, banana, pear. Numbers come before uppercase letters, which come before lowercase letters.

Background

Lines are compared as strings from left to right, using character code order and not a dictionary sense of alphabetical order. That is why 10 comes before 2, and uppercase letters sort ahead of lowercase.

For numeric lists, pad numbers with leading zeros or sort in a spreadsheet. For names in languages with accents, character code order may not match local alphabetical rules.

Common mistakes

  • Sorting numbers as text and expecting 2 to come before 10.
  • Expecting uppercase and lowercase words to mix alphabetically.
  • Sorting lines that belong together, such as multi-line records.

Frequently Asked Questions

Why does 'Zebra' sometimes sort before 'apple'?
Sorting compares lines by character code, and in that ordering uppercase letters come before lowercase letters — so a capitalized word can sort ahead of a lowercase word even though a dictionary would put them the other way around.
Does this sort words within each line, or the lines themselves?
It sorts whole lines relative to each other — each line, no matter how many words it contains, is treated as one unit. Words inside a single line stay in their original order.
Will numbers sort in numeric order?
Not necessarily — lines starting with numbers are compared character by character as text, so "10" can sort before "9" since "1" comes before "9" as a character, even though 10 is numerically larger.
What happens to blank lines when sorting?
Blank lines sort to the very beginning in ascending order (empty content compares as 'smallest'), or to the end in descending order.

Fast, local-first developer micro-tools with zero tracking or latency.

Browse All Tools
Local-First Architecture: Toolium parses payloads exclusively in browser memory. Zero network telemetry.
⌘C Copy⌘K Palette