Sort Text / Alphabetize Lines
Sort lines of text alphabetically, numerically, by length, reverse, or randomly.
How to Use This Tool
Paste your list of lines into the input area.
Paste your list of lines into the input area.
Choose one of 9 buttons
each button is a fixed combination, with no separate order/case toggle.
Pro Tip
Don't bother pre-normalizing capitalization before sorting here — the default alphabetical comparison already sorts mixed-case text sensibly by letter, so a list mixing 'Apple' and 'banana' comes out correctly ordered without any extra step. For any list containing numbers — whether pure numbers or alphanumeric IDs like 'item2'/'item10' — always reach for Numeric ↑ / Numeric ↓ instead of the alphabetical buttons, since text-based sorting will otherwise produce a technically-correct-but-unhelpful lexicographic order.
About This Tool
When to Use
- A librarian alphabetizing a list of 200 book titles for a catalog export, sorting the raw pasted list before formatting it into a final document.
- A teacher sorting a class roster of student names alphabetically before generating a seating chart for the semester, relying on the default sort's sensible mixed-case handling.
- A researcher ordering a list of citation authors alphabetically to match the exact format required by APA reference list conventions.
Key Details
Sort text alphabetizes lines of text — or sorts them numerically, reverses them, randomizes them, or orders them by length — turning an unordered list into a structured one without manually dragging r...
Worked example
Paste an unordered list of five names — 'Zoe, Amir, Priya, Ben, Diego' each on its own line — and select alphabetical sort: the tool returns 'Amir, Ben, Diego, Priya, Zoe' in correct order, or switch to length sort to instead get 'Zoe, Ben, Amir, Diego, Priya' ranked shortest to longest. For a numeric example, paste '1, 10, 100, 2' (one per line) and select Numeric ↑: the tool correctly returns '1, 2, 10, 100', unlike the alphabetical A → Z button, which would return '1, 10, 100, 2' since it compares lines as plain text. Try alphabetical sort on 'zoe, AMIR, priya, BEN, Diego' (inconsistent case) and it still returns correct alphabetical order — 'AMIR, BEN, Diego, priya, zoe' — confirming the default comparison handles mixed case gracefully without needing any extra setting.
Interpreting your result
If a mostly-numeric list doesn't come out in the numeric order you expected using the alphabetical buttons (like '10' sorting before '2'), that's expected text-based sorting, not a bug — switch to the Numeric ↑ / Numeric ↓ buttons instead for genuine numeric ordering. If you need both sorted and deduplicated output, remember that's two separate tools, not one combined option here.
Sort Text / Alphabetize Lines FAQ
How do I alphabetize a list online?
Paste your list (one item per line) into this tool and click 'A → Z'. The tool sorts all lines alphabetically in ascending order in under a second. You can also sort 'Z → A' (reverse alphabetical) or by line length.
Does sorting work correctly for numbers?
Use the dedicated 'Numeric ↑' / 'Numeric ↓' buttons for that — they use a numeric-aware comparison, so a list of '1', '2', '10', '100' correctly sorts as '1, 2, 10, 100' rather than the lexicographic '1, 10, 100, 2' order the alphabetical buttons would produce. This also works on mixed alphanumeric entries like 'item2' vs. 'item10', correctly placing 'item2' first.
Is the sort case-sensitive, and is there a toggle for it?
There's no case-sensitivity toggle anywhere in this tool — alphabetical sort always uses the same comparison. In practice, that default comparison already handles mixed case sensibly: it sorts primarily by letter regardless of case, so 'amir', 'Ben', and 'Diego' land in correct alphabetical order together without any extra setting or pre-processing step needed.
Can I sort and remove duplicates at the same time?
No — there's no combined 'Sort + Deduplicate' option in this tool. Sorting and deduplication are two separate tools: sort your list here first, then run the result through the separate Remove Duplicate Lines tool (or the reverse order, whichever you prefer) as a genuine two-step workflow.
What does 'sort by length' do?
Sort by length orders lines from shortest to longest (Length ↑) or longest to shortest (Length ↓), based on character count. This is useful for formatting lists where you want shorter items first, or for finding unusually long entries in a dataset.
Why does alphabetical sort put numbers before letters?
In this tool's text-based alphabetical sort, a line starting with a digit sorts before a line starting with a letter — so '1 Apple' appears before 'Banana'. If you have a mixed list of numbers and words where that ordering isn't what you want, try the Numeric sort buttons instead, or manually reposition entries after an alphabetical sort.
Master Your Entire Toolkit
Access 500+ specialized calculators and tools designed for precision. No sign-up required, 100% free.
Built and reviewed by the Toolzip Team · Based on MDN Web Docs — Array.prototype.sort