What is the Line Sorter?#
The Line Sorter puts a scattered list back in order. Paste text with one item per line, and it returns the same lines sorted alphabetically, by length, or by number.
It suits address lists, file names, and exported data. Options control how lines are compared and whether blank or repeated lines stay in the result.
How to Use#
- Paste your text, one item per line, into the input box.
- Pick how to sort the lines and switch the options as needed.
- Check the line counts, then copy the result.
What the Options Do#
- Alphabetical: sorts lines A to Z in dictionary order. Letter case is ignored unless you turn that off.
- Natural (number-aware): works like alphabetical, but runs of digits compare as numbers.
file2comes beforefile10. - Numeric: compares each whole line as a number, from small to large. Lines that are not numbers go last.
- By length: puts short lines first. Lines of the same length fall back to alphabetical order.
- Ascending / Descending: flips the sort direction. Descending reverses the result; in the numeric sort, lines that are not numbers stay last either way.
- Ignore case: treats
Appleandappleas the same line when comparing. Turn it off to keep them apart. - Trim spaces: removes leading and trailing spaces before comparing. The result shows the trimmed lines.
- Remove empty lines: drops blank lines from the result. Useful for cleaning up extra line breaks left over from copying.
- Remove duplicates: keeps only the first occurrence of each repeated line from the input.
Common Use Cases#
- Sorting a mailing list or a roster of names before sharing it.
- Putting numbered file names such as
img2.pngandimg10.pngin the right order. - Arranging timestamped log lines from the oldest entry to the newest.
- Ordering keywords by length to pick out the shortest ones.
FAQ#
Lines that compare equal keep their original relative order. Duplicates are kept unless "Remove duplicates" is on.
They sort first in ascending order and last in descending order. With the numeric sort they always go last. Turn on "Remove empty lines" to drop them from the result.
A line counts as a number when the whole line parses as one. Lines with digit grouping or units,
such as 1,000 or 10px, count as text and go last.
No. Everything runs in your browser, and your text never leaves your device.
Notes#
- The output always uses Unix line breaks (LF), even when the input contains Windows (CRLF) or old Mac (CR) line breaks.
- Full-width and half-width letters and digits are not normalized, and "Remove duplicates" does not merge them. With "Ignore case" on, they compare as equal and keep their original order when sorting; with it off, they are sorted apart.