Sort Lines
Paste a list of lines, names, emails, URLs or SKUs, and this tool orders them alphabetically. Choose the direction (A-Z or Z-A), decide whether the comparison is case-sensitive, and optionally trim surrounding whitespace and drop empty lines before sorting. The comparison is by character code point, so it is fast and predictable rather than language-aware.
How sorting works
-
1
Paste your lines
One entry per line. Trailing spaces and blank lines can be trimmed or removed first.
-
2
Choose the direction
A-Z (ascending) or Z-A (descending). Z-A is simply the ascending order reversed.
-
3
Set the options
Turn case-sensitive matching on or off, and decide whether to trim whitespace and remove empty lines.
-
4
Copy the sorted result
Click Sort Lines, then copy the ordered list.
How the comparison works
Lines are compared character by character using their underlying character codes. There is no numeric, natural, length or locale-aware mode, so the behaviour is simple and consistent.
| Option | Behaviour |
|---|---|
| Case-insensitive (default) | Apple and apple are treated as equal; the original order breaks ties. |
| Case-sensitive | Uppercase letters sort before lowercase, because A (code 65) comes before a (code 97). |
| Direction A-Z | Ascending by character code. |
| Direction Z-A | The A-Z order reversed. |
| Trim whitespace | Leading and trailing spaces are removed before sorting. |
| Remove empty lines | Blank lines are dropped from the result. |
What this sorter does not do
- No numeric or natural sort.
file10sorts beforefile2, because the second character1beats2. For version-style ordering you need a natural-sort tool. - No de-duplication, no shuffle, no sort by length. Identical lines are kept.
- Not language-aware. Accented and non-Latin letters are ordered by their byte values, so they fall after the plain
A-Z/a-zrange rather than next to the base letter a reader would expect.
Sorting names in different languages
Because the comparison is by character code, keep in mind:
- Spanish.
ñsorts afterz, not betweennando. - German.
ä,ö,üandßsort afterz; they are not folded toa/o/u/ss. - Swedish.
å,ä,öalso fall afterz, which happens to match Swedish order for these letters. - Turkish. The dotted and dotless
iare not treated as distinct letters, and case-insensitive matching uses ASCII rules, soİandıdo not fold the way Turkish expects.
If you need dictionary-accurate ordering for a specific language, sort in a spreadsheet or a locale-aware tool instead.
Lexicographic vs natural order
A list like file1, file2, file10 sorts as file1, file10, file2 here, because 1 before 2 is decided at the second character. That is standard lexicographic order. Natural sort, which reads the digit runs as numbers to give file1, file2, file10, is a different algorithm this tool does not apply.
Frequently Asked Questions
Uppercase letters have lower character codes than lowercase ones (A is 65, a is 97), so they come first. With case-sensitive matching off, upper and lower case are treated as equal and the original order breaks ties.
No. Lines are compared as text, character by character, so 10 sorts before 2 and file10 before file2. For true numeric or version ordering, use a natural-sort tool or a spreadsheet.
No. Each whole line is treated as a single key. For column-based sorting, use a spreadsheet or sort -k at the command line.
No. It can trim whitespace and drop empty lines, but identical lines are kept. Remove duplicates with a dedicated tool first if you need a unique list.
Related Tools
Meme Text Generator
Add classic meme captions to a template or your own image. Set top and bottom text, tune font, color and stroke, then download or copy a PNG.
Word Counter
Count words, characters, sentences and paragraphs with reading time, speaking time, keyword density and a Flesch readability score for essays, posts, captions and meta descriptions.
Password Generator
Generate strong random passwords with adjustable length, symbols, numbers and mixed case using cryptographic randomness.
Emoji Kitchen
Try verified Google Emoji Kitchen sticker pairs, download PNGs, and get supported suggestions when a pair is not in the curated set.
Glitch Text Generator
Create Zalgo-style glitch text with Unicode combining marks. Choose intensity, preview variants and copy corrupted text for profiles, memes or horror posts.
Wingdings Translator
Turn Latin letters and digits into Wingdings-style Unicode symbols for puzzles, jokes and retro Windows notes.
Tool available in other languages
- 줄 정렬 [KO]
- Trier les lignes [FR]
- ترتيب الأسطر [AR]
- Urutkan Baris [ID]
- Sortera rader [SV]
- Regels sorteren [NL]
- จัดเรียงบรรทัด [TH]
- Sortowanie wierszy [PL]
- Zeilen sortieren [DE]
- Ordenar líneas [ES]
- 行の並べ替え [JA]
- Sắp xếp dòng [VI]
- Ordenar linhas [PT]
- Ordina righe [IT]
- Сортировка строк [RU]
- Satırları Sırala [TR]
- 行排序 [ZH]