Sort Lines
Alphabetically sort lines.
Sort Lines at a glance
Sort Lines is a free online text tool you can use right now to alphabetically sort lines โ no account, no install and no usage limit. It runs entirely inside your browser, so whatever you enter stays on your own device.
- Price
- Free โ no trial, no paid tier, no watermark
- Sign-up
- Not required
- Where it runs
- In your browser โ nothing is uploaded to a server
- Works on
- Chrome, Safari, Firefox and Edge โ desktop, tablet and phone
- Category
- Text Tools
About Sort Lines
Paste a list and sort it alphabetically or numerically, in either direction.
Alphabetical sorting of numbers is the classic surprise. Sorted as text, 10 comes before 2, because sorting compares character by character and '1' precedes '2'. A list of file names or version numbers sorted alphabetically produces an order that looks broken: v1, v10, v11, v2. Numerical sorting reads each line as a number and orders by value, which is what you want whenever the lines are quantities.
Case sensitivity changes results too. A strict sort orders by character code, placing all uppercase letters before all lowercase ones โ so Zebra precedes apple. That is rarely what a human wants from an alphabetical list, which is why case-insensitive sorting is usually the better default for names and words.
Sorting is also a quick way to inspect data. Adjacent duplicates become obvious, and outliers at the top and bottom of a numerically sorted list are visible immediately โ often faster than a formal check.
How to use Sort Lines
- Paste your lines into the box.
- Choose alphabetical or numerical, and ascending or descending.
- Copy the sorted result.
Frequently asked questions
Why does 10 sort before 2?
Because alphabetical sorting compares character by character, and '1' comes before '2'. Switch to numerical sorting to order by value rather than by text.
Why do capitals sort before lowercase?
A strict sort orders by character code, and all uppercase letters have lower codes than lowercase ones โ so Zebra precedes apple. Use case-insensitive sorting for a more natural alphabetical order.
Are blank lines kept?
They are grouped together in the sorted output. Removing them before sorting gives a cleaner result if they are not meaningful.
Can I sort and deduplicate at once?
Sorting and deduplication are separate operations here. Sorting makes duplicates adjacent and therefore easy to spot, then use the duplicate remover to strip them.