Sort lines
Sort a list alphabetically or in natural number order, ascending or descending, while preserving duplicates.
How it works & useful details
How to use this tool
Paste one item per line and choose the sorting method and direction. Natural number order puts item2 before item10. Duplicates stay in the result.
How the result is calculated
Sorting uses your browser’s English Intl.Collator. By default, case and accents compare equally; enable the distinction when needed. Ties keep their original order in both directions. Leading/trailing spaces are retained and participate in sorting. This is not a decimal, signed-number, or version-number parser.
Line tools normalize CRLF and CR to LF. A final newline represents an empty final line; empty input has zero lines.
Up to 500,000 UTF-16 code units per input. Text stays on your device.
