Sort Lines
Sort lines alphabetically, numerically, by character length, reverse, or shuffle locally in your browser with zero uploads.
About this tool
Lines split cleanly on LF/CRLF boundaries, optionally filter blank lines, and sort in memory using localeCompare, numeric parseFloat extraction, character length comparison, or Fisher–Yates unbiased shuffling.
How to use the line sorter
- Paste your list into the box, with one item on each line.
- Choose a sort order: A–Z, Z–A, Numeric, By length or Reverse.
- Choose Shuffle to put the lines in a random order, if you need a random draw.
- Copy the sorted list, or download it as a .txt file.
How each sort works
A–Z and Z–A compare the lines alphabetically and ignore upper and lower case, so Apricot sits next to apple. Numeric reads the number at the start of each line, so 2 comes before 10, which a plain alphabetical sort would not do. By length orders lines from shortest to longest, which helps when you need a neat column of names or codes.
Reverse flips the current order without changing the lines, and Shuffle gives a new random order each time you press it. Use Shuffle to pick a random winner, or to test that your code does not depend on order.
A worked example
The sample list mixes fruit names with lines that start with numbers. A–Z puts the fruit in alphabetical order and mixes in the numbered lines by their first character. Numeric moves the numbered lines into order by value, so 2 apples comes before 10 bananas. The difference between the two sorts shows why choosing the right one matters.
- Sort a list of file names so that file2 comes before file10 by using Numeric.
- Put a list of names into A–Z order before you print an attendance sheet.
Who uses a line sorter
- Teachers and event organisers ordering names on lists and registers.
- Developers sorting imports, dependency lists and configuration keys.
- Writers ordering glossary entries, index terms or bibliography lines.
- Analysts putting a list of IDs into order before comparing it with another list.
- Anyone who needs a neat list in a few seconds.
Tips and common mistakes
- A–Z ignores upper and lower case. Use Numeric or check spacing when the list contains codes.
- Numeric only uses the leading number on each line. Lines without a number are placed in a sensible order.
- Duplicate lines are kept. Use the Remove Duplicate Lines tool first if you want each item once.
- Shuffle is random, so the result changes each time. Copy the list before you shuffle if you want to keep the order.
- All sorting happens in your browser, so a private list never leaves your device.
Frequently asked questions
Related browser tools
Word Counter
Count words, unique words, characters without spaces, sentences, reading time, speaking time, and keyword density locally in your browser with zero uploads.
Case Converter
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case, and kebab-case locally in your browser with zero uploads.
Remove Duplicate Lines
Remove duplicate lines from any list or text file locally in your browser with case-sensitive, trim whitespace, blank-line, and A-Z sort options.