Line Sorter
Sort lines of text alphabetically in your browser for lists, data cleanup, tags and simple text processing.
Your result will appear here.
Line Sorter online
Sort the lines of a list into natural alphabetical order — numbers inside lines counted by value, so file2 sorts before file10 the way a human expects.
How to use this tool
- Paste your lines into the input box, one item per line.
- Click Run Tool. Lines are reordered using locale-aware comparison with numeric awareness.
- Copy the sorted list from the result panel.
Common uses
Alphabetising name lists, tag collections and keyword sets, ordering filenames and version strings, tidying exported data before a diff, and preparing lists for deduplication (sorted duplicates sit next to each other, easy to spot).
How it works
Sorting uses your browser's locale collation with two helpful settings: numeric awareness, so embedded numbers compare by value rather than character by character (2 before 10), and base sensitivity, so case and accents do not split the alphabet — Apple, apple and Äpple sort as neighbours rather than in separate code-point blocks. The sort is ascending only, and it is a pure rearrangement: duplicate lines are kept, and empty lines — which sort before everything — float to the top.
Worked example
The list
item 10 Item 2 item 1
sorts to
item 1 Item 2 item 10
A plain character sort would have given 1, 10, 2 and put the capital-I line in a different neighbourhood entirely; the locale rules are doing real work here.
Privacy and browser processing
Your text is sorted in your browser with JavaScript — it is never uploaded or stored.
Frequently asked questions
Why did my duplicates survive?
Sorting is not deduplication — the tool rearranges lines and changes nothing about their content or count. If you want duplicates gone, run the result through Remove Duplicate Lines (also on this site) afterwards; sorted input makes that a one-pass job.
Can I sort in reverse (Z to A)?
The sorter is ascending only. For a descending list, sort here, then reverse the lines with any editor's reverse-lines command — or paste into a spreadsheet column where both directions are a click.
Why did the empty line end up first?
An empty string compares less than any non-empty line, so blank lines gather at the top. Delete them first (the Whitespace Remover here strips blank lines) if they are not wanted at all.
Does it sort numbers that start the line?
Yes, by value: a line beginning "10" sorts after one beginning "2". The numeric awareness applies wherever digits appear in the line, including version strings like v1.9 vs v1.10, which order correctly here.
Is my list uploaded?
No. Sorting runs in your browser; your text never leaves the page.