Sort Lines Online
Sort any list of lines online for free. Order A to Z, Z to A, by number or by length, shuffle, and remove duplicates or empty lines, all in your browser without uploading your text.
How to sort lines
Three quick steps, no account needed.
Why use this tool
Built for speed, privacy and tidy lists.
About sorting lines
What each order does and when to use it.
What does sorting lines mean?
Sorting lines rearranges a list so each line sits in a chosen order. The tool treats every line break as the end of one item, so it works for names, keywords, URLs, file names, product codes and any other one-per-line list.
Which order should you pick?
- A to Z or Z to A for words and names.
- Natural for file names or codes with numbers inside, such as img2 and img10.
- Numeric for lists that are only numbers, including decimals and negatives.
- By length to find the shortest or longest entries.
Clean up at the same time
Tick Remove duplicates to keep one copy of each line, Remove empty lines to drop blanks, and Trim spaces to ignore stray spaces at the start and end. Next you may want to turn your titles into URL slugs with the slug generator.
Sort orders compared
The same list, ordered three ways.
| Order | Input: 10, 2, 1, b, a | Best for |
|---|---|---|
| A to Z | 1, 10, 2, a, b | Words and names |
| Natural | 1, 2, 10, a, b | File names with numbers |
| Numeric | 1, 2, 10, a, b | Lists of numbers |
| Longest first | 10, 2, 1, b, a | Finding long entries |
Frequently asked questions
Quick answers.
Is my text uploaded anywhere?
No. Sorting runs inside your browser. Your text never leaves your device.
What is the difference between A to Z and natural sort?
A to Z compares text character by character, so file10 comes before file2. Natural sort reads the digits as numbers, so file2 comes before file10.
How do I sort numbers correctly?
Choose the Numeric order. Lines are compared by their number, so 2 comes before 10. Lines that are not numbers are placed at the end.
Does sorting ignore uppercase and lowercase?
Yes, by default. Untick Ignore case if you want capital and small letters treated as different, which also changes how duplicates are matched.
Can I remove duplicate lines?
Yes. Tick Remove duplicates and only the first copy of each line is kept. The Ignore case setting decides whether Apple and apple count as the same line.
Is there a limit on how long the list can be?
Nothing is uploaded, so there is no server-side limit. The practical limit is your device memory. For extremely long lists, sort in smaller groups.
More tools
Related text and data tools.