Sort Lines Alphabetically Online
Paste any list of text — one item per line — and sort it A to Z, Z to A, by length, reverse, or shuffle randomly. Free, instant, no signup.
Alphabetical order has been the dominant retrieval technique for nearly two millennia. The first full alphabetical dictionary of English — Robert Cawdrey's Table Alphabeticall from 1604 — sorted 2,543 hard words so readers could look them up without knowing their Latin or Greek roots. The technique persists because lexicographic ordering is the one sort humans can apply without a computer: scanning a sorted list of 1,000 items takes about ten comparisons in the worst case.
Modern sort implementations have largely converged on Timsort, a hybrid of merge sort and insertion sort designed for data that often arrives partially pre-sorted in runs. Python's list.sort() and JavaScript's Array.prototype.sort() both use Timsort or a derivative. Its key property: O(n) time when the input is already sorted, O(n log n) worst case — which is why sorting a nearly-sorted list of tens of thousands of lines feels nearly instant.
The default sort here is case-insensitive, which matches expectations for names, tags, domain lists, and keyword sets. For numeric or multi-column data, a spreadsheet is the right tool. Pair with duplicate line removal first — deduplicating before sorting ensures the final list has no repeated entries and is straightforward to scan.
How to sort a list alphabetically online
Put each item on its own line in the text box above (one item per line), then click Sort A → Z. The sorted list appears below — click Copy to grab it. Use Sort Z → A for reverse alphabetical. Use Shuffle randomly to randomize the order.
Frequently asked questions
How do I alphabetize a list in Word?
In Microsoft Word: select your list, go to Home → Paragraph → Sort button (AZ↓). Choose "Text" and "Ascending". Alternatively, paste your list here and click Sort A→Z — it's faster and works on any device including phones.
How do I sort a list in Google Sheets?
In Google Sheets: select the column, go to Data → Sort Sheet → A to Z. For a text list that's not in a spreadsheet, paste it here instead — one item per line, click Sort A→Z, copy the result.
Is the sort case-sensitive?
No — the sort is case-insensitive, so "apple", "Apple", and "APPLE" are treated as equal and sorted together. This is the behavior most users expect when alphabetizing a mixed-case list.
Can I sort numbers?
The sort treats all input as text, so numbers sort lexicographically — 10 comes before 2 because "1" comes before "2" alphabetically. For true numeric sorting, put your numbers in a spreadsheet and use the numeric sort option there.
Can I sort comma-separated items?
This tool sorts line by line. To sort comma-separated items: replace commas with newlines first (paste into a text editor, Find & Replace ", " with a newline), sort here, then replace newlines back with commas.
How do I sort a list in Python?
Use the built-in sorted() function to return a new sorted list: sorted_list = sorted(my_list). To sort in place, use my_list.sort(). Both default to ascending (A→Z) order. Add reverse=True for descending order, and key=str.lower for case-insensitive sorting.
How do I alphabetize a list in Excel?
Select the column you want to sort, then go to Data → Sort A to Z (or Sort Z to A for reverse). If your list has a header row, make sure "My data has headers" is checked. For a plain text list not in a spreadsheet, paste it here and use the Sort A→Z button — it's faster.
How do I sort a list in Google Sheets?
Select the cells you want to sort, go to Data → Sort range → Sort range by column A (A to Z). To keep a header row in place, check "Data has header row." For a text list outside a spreadsheet, paste it here instead — no spreadsheet required.
How do I sort bullet points in Word?
Select the bulleted list, then go to Home → Paragraph group → Sort button (the AZ↓ icon). Set "Sort by" to Paragraphs, Type to Text, and choose Ascending or Descending. Alternatively, paste the list here (without bullet symbols), sort it, then paste back into Word.
Can I sort numbers numerically, not alphabetically?
This tool sorts text, so numbers sort lexicographically — 10 appears before 2 because "1" comes before "2" as text. For true numeric sorting, paste your numbers into a spreadsheet (Excel or Google Sheets) and use its numeric sort option. The "Sort by length" option here sorts by character count, not numeric value.
How do I sort a list by last name?
Rearrange names to "Last, First" format first — for example, change "John Smith" to "Smith, John". Then paste the list here and sort A→Z. The sort will order alphabetically by last name. After sorting, you can reformat the names back to "First Last" if needed.
What does "shuffle randomly" do?
Shuffle randomly randomizes the order of your lines using an algorithm similar to the Fisher-Yates shuffle — each line has an equal probability of ending up in any position. Every run produces a different result. It's useful for randomizing quiz questions, creating random assignment orders, or splitting a list into random groups.