Sort Text Online
Paste a list and sort it the way you need it: A to Z, Z to A, by length, numerically, into reverse order or shuffled. Trim whitespace, drop blank lines and remove duplicates as you go. Free, and it all happens in your browser.
Number sorts put lines with no number at the end, in their original order. Shuffle gives a different arrangement each time.
Your text stays in your browser. Nothing is uploaded.
What This Text Sorter Does
This is a free online text sorter and alphabetizer. You paste a list — one item per line — and it puts that list into the order you choose, instantly and in your own browser. There is nothing to install, no account to create and no file to upload.
Eight orders are available: alphabetical A → Z, reverse alphabetical Z → A, shortest to longest, longest to shortest, numeric ascending, numeric descending, reverse of the order you pasted, and a random shuffle. Four cleaning options sit alongside them, so you can trim stray spaces, drop blank lines and remove duplicates on the way through.
The result updates as you type. Five counters underneath — original lines, result lines, original characters, result characters and duplicates removed — are measured on every pass from the text actually in the boxes, so they always describe what you are looking at.
How to Alphabetize Text Online
- Paste your list into the Your Lines box, one item per line. Anything works: names, words, URLs, numbers, hashtags, rows copied out of a spreadsheet.
- Read the sorted result on the right. A → Z is already selected, so the list is alphabetized the moment you paste it.
- Adjust the options if you need to. Ignore case, Trim whitespace and Remove blank lines are on by default; Remove duplicate lines is there if your list has repeats.
- Copy it with Copy Output and paste it wherever it is going.
That is the whole process. Alphabetizing happens on your device, so a list of a few lines and a list of a few thousand both sort immediately.
What “Alphabetical” Means Here
The comparison is locale-aware rather than a raw character-code sort, which matters more than it sounds. Accented letters sit with their base letter, so “éclair” sorts next to “eagle” instead of after the entire alphabet. Numbers inside text are compared as numbers, so “item 2” comes before “item 10”. And because equal lines keep the order you typed them in, running the same list through twice always gives the same answer.
Different Ways to Sort Text
- A → Z — standard alphabetical order, the default. Best for names, word lists, glossaries and anything a reader expects to scan in order.
- Z → A — the same comparison run backwards. Handy for reverse-chronological headings or putting the end of the alphabet first.
- Shortest → Longest — orders by character count. Useful for finding the shortest title that fits, or for spotting the one over-long line in a list.
- Longest → Shortest — the same, descending. Good for reviewing the wordiest entries first.
- Number: low → high — reads the first number on each line and sorts by value, so 9 comes before 10. Use it for prices, scores, counts, dates written as numbers and row references.
- Number: high → low — the same, descending, for top-ten lists and biggest-first rankings.
- Reverse order — flips the list end to end without alphabetizing it, so the last line becomes the first.
- Shuffle — deals the list into a random arrangement. Use it to pick a winner, randomise a playlist, sample a list or break a tie fairly.
Lines That Do Not Fit the Order
Two rules cover the awkward cases. In a numeric sort, a line with no number in it is moved to the end and keeps its original order relative to the other non-numeric lines. It is never silently dropped and never treated as zero. And in every sort, lines that compare equal stay in the order you typed them in, which is what makes the result predictable rather than arbitrary.
Clean and Organize Your Lists
Sorting is only half of tidying a list. The four options handle the other half, and each one is independent. Use any combination.
- Ignore case — treats “Apple” and “apple” as the same word for ordering, so a mixed-case list alphabetizes properly instead of splitting into a block of capitals and a block of lowercase. On by default. It also decides what counts as a duplicate when Remove duplicate lines is on.
- Trim whitespace — removes spaces, tabs and non-breaking spaces from the start and end of each line, so an indented list sorts by its content rather than by its indentation. On by default.
- Remove blank lines — drops empty lines, including lines that contain only spaces or tabs, which would otherwise pile up at the top of an alphabetized list. On by default.
- Remove duplicate lines — drops repeated lines and keeps the first occurrence, in your original order, before the list is sorted. Off by default, so nothing is ever deleted unless you ask for it. The Duplicates Removed counter reports how many went.
Turn all four off and the sorter will only rearrange your lines. It will not edit a single character of them.
Common Uses
- Alphabetizing lists — put any list of items into plain alphabetical order in one pass.
- Sorting names — order a list of people, contacts or authors by surname or first name.
- Sorting lists of words — build a glossary, an index or a vocabulary list in A–Z order.
- Organizing copied text — paste a block copied from anywhere and get a tidy, ordered list back.
- Sorting lists from spreadsheets — re-order a column you copied out of Excel or Google Sheets without opening it again.
- Sorting numbers — put values, prices, scores or row references into ascending or descending order.
- Cleaning and organizing text — trim stray spaces, drop blank lines and sort in one step.
- Removing duplicate entries — de-duplicate a merged list while you alphabetize it.
- Preparing lists for documents or spreadsheets — arrive with an ordered, clean list instead of a jumbled one.
- Organizing AI-generated or copied text — turn a rambling AI list into something you can actually scan.
Your Text Never Leaves Your Browser
Text Sorter & Alphabetizer runs entirely in your browser. There is no API call, no upload, no database and no server-side text processing. Your list is sorted on your own device and is never sent anywhere. That makes it safe for client names, contact lists, unpublished research, salary bands or anything else you would rather not paste into a website.
It also means the tool is fast: sorting happens the instant you type, with no round trip to wait for, and it keeps working offline once the page has loaded.
Frequently Asked Questions
How do I sort text alphabetically online?
Paste your list into the left-hand box, one item per line, and the sorted result appears on the right as you type. A → Z is already selected, so there is nothing else to do: no button to press and nothing to upload. Ignore case, Trim whitespace and Remove blank lines are on by default, which is what most people mean when they say “alphabetize this”.
Can I sort text from A to Z?
Yes — that is the default. Sorting uses your browser’s locale-aware comparison with numeric awareness, so accented letters fall in the right place (é sits with e) and “item 2” comes before “item 10” instead of after it. Lines that compare equal keep the order you typed them in, so the result is always reproducible.
Can I sort text from Z to A?
Yes. Choose Z → A and the list is alphabetized in reverse. It is the same comparison run backwards, not the A → Z result flipped, so equal lines still keep their original relative order rather than being silently reversed.
Can I sort numbers?
Yes. Number: low → high and Number: high → low read the first number on each line and order by its value, so 9 sorts before 10 and negative numbers and decimals work as you would expect. Thousands separators are understood in proper groups (“1,234” reads as 1234). The number does not have to be the whole line: “3 apples” sorts by the 3. Lines with no number at all are moved to the end, in the order you typed them, whichever direction you sort.
Can I sort text by length?
Yes. Shortest → Longest and Longest → Shortest order by the number of characters in each line, measured after trimming if Trim whitespace is on, so you are sorting the length of what you actually get. Lines of the same length keep their original order.
Can I remove duplicate lines while sorting?
Yes. Switch on Remove duplicate lines and repeated lines are dropped before the list is ordered, keeping the first occurrence. Ignore case decides what counts as a repeat: with it on, “Apple” and “apple” are duplicates; with it off, they are two different lines. The Duplicates Removed counter tells you exactly how many went. It is off by default, so the tool never deletes a line you did not ask it to.
What do Reverse order and Shuffle do?
Reverse order turns the list upside down: the last line becomes the first. Shuffle deals it into a random arrangement, useful for picking a name out of a hat, randomising a playlist or sampling a list. Shuffle is genuinely random, so it produces a different arrangement each time you change anything on the page, and the same lines always come back out, just in a new order.
Will sorting change my text?
Only in the ways you have asked for. Reordering never edits a line. The three cleaning options do edit, and each is visible and switchable: Trim whitespace removes spaces and tabs at the start and end of a line, Remove blank lines drops empty ones, and Remove duplicate lines drops repeats. Turn all three off and the sorter will only ever rearrange what you pasted.
Is my text uploaded?
No. Your text stays in your browser. There is no API call, no upload, no database and no server-side processing. The list is sorted on your own device and never sent anywhere. The tool keeps working offline once the page has loaded.