Sort Lines
Alphabetically or numerically sort lines of text.
Lines0
Characters0
What is this?
Sort Lines reorders the lines of your text alphabetically, numerically, by length or randomly, so lists become clean and consistent.
How it works
Pick an order and the lines are re-sorted instantly. Alphabetical sorting can be case-insensitive, numeric sorting reads the leading number of each line, and shuffle randomizes the order.
Examples
Ascending
Input
banana apple cherry
Output
apple banana cherry
Numeric
Input
10 2 1
Output
1 2 10
Use cases
- Alphabetize names, tags or glossary terms.
- Order numeric data such as IDs or prices.
- Randomize a list for draws or sampling.
- Organize import files before processing.
FAQ
- How does numeric sorting handle text?
- It parses the leading number of each line; lines without numbers are treated as NaN and grouped together.
- Is sorting stable?
- JavaScript array sort is stable in modern browsers, so equal lines keep their relative order.