Sort lines of text
Numbers & text
Paste your lines and choose how to sort them.
Runs in your browser
Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.
About this tool
Natural and language-aware sorting
Alphabetical sorting here is natural: file2 comes before file10, where a plain character sort would put file10 first because 1 is less than 2.
It is also language-aware. Swedish puts å, ä and ö after z; German treats ä as a; Spanish no longer separates ch. Sorting uses the collation rules of the page’s language rather than comparing code points, which is the only way those come out right.
Questions
Why is file10 after file9 here but not in my editor?
This uses natural sorting, which reads runs of digits as numbers. A plain sort compares character by character, so "1" in file10 beats "9" in file9.
Related tools
Remove duplicate linesDelete repeated lines while keeping the original order. Ignore case, trim whitespace first, drop empty lines, or keep the last occurrence.Clean whitespaceCollapse double spaces, trim lines, remove empty lines and line breaks, convert tabs, and strip the invisible Unicode spaces that text pasted from a PDF carries.Amount in wordsWrite a money amount in words with the right minor unit and precision for each currency: cents, piastres, halalas, millimes, and the cheque form.Base converterConvert between binary, octal, decimal, hex and any base from 2 to 36. Exact at any size, including 64-bit values a floating-point tool corrupts.