Sort lines
Paste a column. Sort as text (locale-aware) or as numbers. Reverse if you need Z–A.
How to use the Sort lines
What does the Sort lines do?
Sort pasted lines A–Z, Z–A, or as numbers; It applies this page-specific rule: text sort uses the browser’s localeCompare so letters from the same language group together better than a raw code-point sort.
Which inputs does this tool use?
To sort pasted lines a–z, z–a, or as numbers, enter Lines; keep every value in the same example; the page then updates the result from the current values; Start with a familiar case covered by this rule - Blank lines stay in the list unless you delete them first - so the expected result can confirm the settings.
How should the tool result be read?
For a result intended to sort pasted lines a–z, z–a, or as numbers, blank lines stay in the list unless you delete them first; read lines together with the original lines rather than as an isolated answer, and confirm that its units or structure match the intended use.
Natural sort of IMG_2 / IMG_10?
When the goal is to sort pasted lines a–z, z–a, or as numbers, use numeric mode if the number is at the start.
Stable?
When using the page to sort pasted lines a–z, z–a, or as numbers, yes - equal keys keep original order.
Limits and accuracy
When using this tool to sort pasted lines a–z, z–a, or as numbers, the result covers the stated calculation and supplied values, not every real-world factor; check the result in its intended destination before relying on it for important work; keep lines until the output has been checked in its intended destination. For a repeatable check when you need to sort pasted lines a–z, z–a, or as numbers, record Lines alongside the final output and selected options.
How this works
Text sort uses the browser’s localeCompare so letters from the same language group together better than a raw code-point sort. Numeric sort parses the leading number on each line (so “10 apples” comes after “2 apples”).
Blank lines stay in the list unless you delete them first. This page does not remove duplicates - pair it with the duplicate-line tool.
Sorting is local. There is no “save”.
Frequently asked questions
Natural sort of IMG_2 / IMG_10?
Use numeric mode if the number is at the start. Embedded numbers in the middle are not a full natural sort.
Stable?
Yes - equal keys keep original order.
Comma-separated?
This sorts lines, not CSV columns.