Sort Text Lines
Paste a list and sort its lines instantly — A→Z or Z→A, with case-insensitive and natural numeric ordering, plus options to drop blank lines and remove duplicates. No upload, no sign-up — your text never leaves your browser.
What is the Sort Text Lines tool?
The Sort Text Lines tool takes a block of text and reorders its lines for you — alphabetically from A to Z, in reverse from Z to A, or in true numeric order when your lines contain numbers. Paste a list, choose how you want it ordered, and the sorted result appears instantly with one-click copy. It is built for the everyday job of turning a messy, out-of-order list into a clean, predictable one without opening a spreadsheet or writing a script.
Every line is sorted entirely in your browser, so even sensitive lists stay on your device. Nothing is uploaded, logged, or saved — the sort runs locally as you type, and closing the tab leaves no trace. Alongside the basic directions you can sort case-insensitively, switch on natural numeric ordering, drop blank lines, and remove duplicate lines in the same pass.
How to use it
- Paste or type your lines into the top box — one item per line.
- Pick a direction: A → Z for ascending or Z → A for descending.
- Toggle the options you need — case-insensitive, natural numeric sort, remove blank lines, or remove duplicates.
- Read the sorted result in the lower box; it updates the instant you type or change an option.
- Click Copy to take the sorted list with you, then close the tab. The whole flow is paste, sort, copy, leave.
The method behind it
Sorting is deterministic and runs entirely in your browser. The tool splits your text on any line ending — Windows, classic Mac, or Unix — so pastes from any system behave identically. It then applies your options in a stable order: optionally drop blank lines, optionally remove duplicates (keeping the first occurrence), and finally sort. The comparison uses the browser's built-in locale-aware compare rather than a naive character-code sort:
- Case-insensitive — compares by base letter, so capitals and lowercase sort together; only the comparison changes, the original capitalization of every line is preserved.
- Natural / numeric sort — reads runs of digits as whole numbers. Plain alphabetical sort compares text character by character, which is why a basic sorter wrongly puts item10 before item2; with natural sort on, item2 correctly comes first.
- Z → A — reverses the comparison result, giving descending order with the same rules applied.
- Remove duplicates — keeps only the first occurrence of each line before sorting; when case-insensitive is on, Apple and apple count as the same line.
Worked example
Starting from the lines banana, Apple, item10, item2, and apple, with A → Z, case-insensitive, and natural sort on, the result is: Apple, apple, banana, item2, item10. Notice that Apple and apple sit next to each other, item2 comes before item10, and the original casing of each word is untouched. Turn on remove duplicates and a second apple would be dropped before sorting.
Common use cases
- Alphabetizing lists — names, book titles, glossary terms, or tags that need to be in order.
- Tidying code and config — sorting import statements, dependency lists, or ignore-file entries.
- Cleaning data — combining lists from several sources, then removing duplicates and ordering what remains.
- Version and file lists — using natural sort so numbered items order the way a human expects.
- Study and writing — putting vocabulary, references, or checklist items into a consistent order before sharing.
Why use this one
Most online sorters do a plain alphabetical pass and stop there. This one adds true natural numeric ordering so numbered items sort correctly, a case-insensitive mode that never rewrites your capitalization, and a remove-duplicates option that cleans the list in the same step. It runs instantly on mobile, needs no account, and never uploads your text.
It is part of a small, focused text toolkit, and each tool has a clear job. This sorter deliberately only reorders lines — it never changes spacing, capitalization, or line breaks. If your text also needs its spacing cleaned up, the Text Formatter collapses extra spaces and trims blank rows. If lines copied from a PDF or email are broken mid-sentence, Remove Line Breaks rejoins them into proper paragraphs first. And to change the capitalization of the same list, the Case Converter switches between UPPERCASE, lowercase, and Title Case in one click.
Frequently asked questions
What is the difference between alphabetical and natural sort?
Plain alphabetical sort compares text character by character, so it places item10 before item2 because the character 1 comes before 2. Natural sort, which you turn on with the numeric option, reads runs of digits as whole numbers, so item2 correctly comes before item10. Use natural sort whenever your lines contain numbers like versions, file names, or numbered items.
Does case-insensitive sorting change the capitalization of my lines?
No. The case-insensitive option only changes how lines are compared so that Apple and apple sort next to each other instead of all capitals coming first. The text in the output keeps the exact original capitalization of every line.
Can it remove duplicate lines while sorting?
Yes. Turn on remove duplicates and the tool keeps only the first occurrence of each line, then sorts what remains. When case-insensitive is also on, Apple and apple count as the same line. This is handy for cleaning up lists pasted from several sources.
Is my text private when I sort it here?
Yes. All sorting happens locally in your browser, so the lines you paste are never uploaded to a server and nothing is stored. Closing the tab leaves no trace.