Sort Text Lines
Paste a list and sort its lines alphabetically, by length or in reverse, with optional de-duplication and trimming. The result updates live and nothing is uploaded.
How to sort lines
- Paste your list — one item per line.
- Pick a sort order, and turn on de-duplication, trimming or blank-line removal as needed.
- Copy the sorted result.
About sorting lines
Sorting lines is handy for tidying lists — names, emails, keywords, log entries or CSV columns — into alphabetical or length order. De-duplication removes repeated entries (keeping the first), which is the fastest way to clean a list that has accumulated copies.
Alphabetical sorting uses locale-aware comparison, and you can make it case-insensitive so “Apple” and “apple” sort together. Trimming and blank-line removal clean up stray whitespace at the same time. Everything is computed in your browser.
Sorted order is a maintenance tool as much as a tidiness one. Keeping lists sorted in files that change often — dependency lists, configuration entries, translation keys, import blocks — means every new item has exactly one correct place, so two people adding entries at the same time rarely collide, and duplicates become obvious neighbours instead of hiding fifty lines apart. Many teams sort such lists as a matter of policy for exactly this reason.
One surprise to expect: alphabetical sorting compares text character by character, so lines containing numbers do not sort numerically — item10 lands before item2 because the character 1 comes before 2. The standard fix is zero-padding the numbers (item02, item10) before sorting. It also pays to trim first when your list comes from a spreadsheet or terminal, since an invisible leading space can pull a line out of the position you expect.
Frequently asked questions
Can it remove duplicate lines?
Yes. Turn on de-duplication and repeated lines are removed, keeping the first occurrence. Combine it with case-insensitive matching to treat differently-cased duplicates as the same.
What sort orders are available?
Alphabetical A–Z and Z–A, by line length (shortest or longest first), and simple reverse (flip the existing order without sorting).
Is sorting case-sensitive?
By default yes, but you can switch on case-insensitive comparison so uppercase and lowercase versions of a word sort and de-duplicate together.
Is my list uploaded?
No. Sorting happens entirely in your browser, so your list never leaves your device.
Can I sort a comma-separated list with this tool?
The tool sorts one item per line, so convert commas to line breaks first — most text editors can find-and-replace a comma with a newline. Sort, then reverse the replacement if you need commas back. This works for semicolon-separated email recipient lists too, a common case where you want alphabetical order with duplicates removed.