Sort the lines of a text alphabetically, naturally, by length, by numeric value or shuffled. Reverse the order with a switch, and optionally trim lines, drop blank lines and remove duplicates in the same pass.
Everything runs locally in your browser. Your data never leaves your device.
A to Z, ignoring case.
Clean up first
Next steps
Send this tool's output straight into another tool.
This tool sorts the lines of a text. Pick alphabetical, natural, line length, numeric or a random shuffle, flip the whole order with the reverse switch, and optionally trim lines, drop blank lines and remove duplicates in the same pass.
Natural sort is the one to reach for when your lines contain numbers: it puts item 2 before item 10, where plain alphabetical sorting does not.
What you can do
Sort lines alphabetically from A to Z or Z to A.
Sort file names and numbered items in natural order.
Sort lines by length, shortest or longest first.
Sort lines by the number they start with.
Shuffle lines into a random order.
Trim whitespace, drop blank lines and remove duplicates while sorting.
How to use the Sort Lines
1Paste your lines into the input box.
2Pick the sorting method, and reverse it if you need the other direction.
3Tick the cleanups you want: trim, remove blank lines, remove duplicates.
4Copy or download the sorted result.
How the methods compare
Alphabetical compares letter by letter and ignores case. Natural does the same but reads runs of digits as numbers, so version 2 sorts before version 10. Numeric looks only at the number a line starts with, which suits price lists and rankings, and lines without a leading number go to the end. Length orders by how long each line is, with ties broken alphabetically. Random shuffles fairly, and the shuffle button deals a new order each time.
If you only need duplicates removed without reordering anything, the Dedupe Lines tool keeps your original line order.