How to Sort a List of Text
Paste a list with one item per line and it's reordered instantly. Alphabetical sorting is the obvious case, but the mode worth knowing about is natural sort: it reads runs of digits inside text as actual numbers, so file2 lands before file10 rather than after it. That single behaviour is what most simple sorters get wrong, and it matters for filenames, version numbers, invoice references and anything else with numbering in it. Beyond ordering, you can sort by line length in either direction, reverse the existing order without re-sorting, or shuffle the list randomly with a button to reshuffle if you don't like the result. Cleanup happens in the same pass: trailing spaces are trimmed, blank lines are dropped, and duplicates can be removed — all honouring the ignore-case setting so Apple and apple are treated as the same entry when you want them to be. A stats row shows how many lines went in, how many came out and how many were removed, so nothing disappears without you noticing. Everything runs in your browser.
Paste your list
One item per line; it's processed locally as you type.
Pick a sort mode
Alphabetical, numeric, by length, reversed or shuffled.
Copy or download
Take the sorted list or save it as a .txt file.
Sort Modes Explained
| Mode | What it does |
|---|---|
| A → Z | Standard alphabetical order |
| Z → A | Reverse alphabetical order |
| Numeric ↑ | Natural sort — digits compared as numbers, ascending |
| Numeric ↓ | Natural sort, descending |
| Shortest first | By character count, ties broken alphabetically |
| Longest first | By character count, descending |
| Reverse order | Flips the current order without sorting |
| Shuffle | Randomises the order; press again for a new one |
Common Use Cases
Alphabetise a list
Put names, terms or references into order in seconds.
Order filenames
Use natural sort so numbered files line up correctly.
Clean an import list
Sort, trim and deduplicate before pasting into a system.
Tidy a glossary
Alphabetise terms and remove accidental repeats.
Randomise entries
Shuffle a list for a draw, a rota or randomised testing.
Find long lines
Sort by length to spot outliers or over-long entries.
Prepare CSV columns
Order a column of values before rebuilding a sheet.
Organise keywords
Sort and dedupe a keyword list for SEO work.
Tips & Best Practices
Use natural sort for anything numbered
Filenames, versions and invoice references all need it — plain alphabetical will scramble them.
Trim before comparing
Invisible trailing spaces make identical-looking lines sort apart; leave trimming on.
Ignore case for names
Mixed capitalisation otherwise groups all uppercase entries before lowercase ones.
Check the removed count
If the stats show lines disappearing unexpectedly, a cleanup option is doing more than you meant.
Dedupe after trimming
Trimming first means lines differing only by whitespace collapse into one.
Shuffle needs a fresh press
Changing other options keeps the same shuffle; use the reshuffle button for a new order.
Troubleshooting
item10 sorted before item2
You're using alphabetical mode. Switch to Numeric to get natural ordering where digits compare as numbers.
Uppercase entries grouped separately
Turn on ignore case, otherwise capital letters sort before all lowercase ones.
Lines disappeared
Remove blank lines or remove duplicates is on. Check the removed count in the stats row.
Identical lines didn't dedupe
One probably has trailing whitespace. Turn on trim so they compare as equal.
Frequently Asked Questions
How do I sort text lines for free?
Paste your list with one item per line and pick a sort mode. The result appears instantly — free, no signup.
What is natural sort?
It compares runs of digits as numbers, so item2 comes before item10 instead of after it.
Why does item10 come before item2 normally?
Plain alphabetical sorting compares character by character, and the digit 1 sorts before 2. Natural sort fixes that.
Can I sort in reverse?
Yes. Use Z to A for reverse alphabetical, or Reverse order to flip the list without re-sorting.
Can I sort by line length?
Yes. Shortest first or longest first, with ties broken alphabetically.
Can I shuffle instead of sorting?
Yes. Shuffle randomises the order, and the reshuffle button gives you a new arrangement.
Does it remove duplicates?
Optionally. Turn on remove duplicates and repeated lines are dropped while sorting.
Is sorting case sensitive?
Ignore case is on by default. Turn it off if capitalisation should affect the order.
What happens to blank lines?
They're removed by default. Turn off remove blank lines to keep them.
Does it trim whitespace?
Yes, by default. Trimming means lines differing only by spaces compare and dedupe correctly.
Is my list sent to a server?
No. Everything runs in your browser, so your data never leaves your device.
How many lines can it handle?
It comfortably sorts thousands of lines right in your browser.
Can I download the result?
Yes. Save the sorted list as a .txt file, or copy it to your clipboard.
Does it handle non-English text?
Yes. Sorting uses locale-aware comparison, so accented and non-Latin characters order sensibly.
Can I sort comma-separated values?
Put each value on its own line first — this tool sorts by line.
Does it work offline?
Once the page has loaded it runs entirely in your browser, so it keeps working without a connection.
Does it work on phones?
Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.
Is this tool really free?
Completely free, forever — no account, no ads and no premium wall.
100% free · No signup · Processed in your browser · Data never sent
Last updated: August 2026 · FlipMyFormat Sort Text
Written and maintained by the FlipMyFormat team · Runs entirely in your browser