Free tool · Writing tools
Sort lines alphabetically
Paste a list, one item per line, and see it sorted at once. Choose the order, the language rules and what to ignore. Your list stays on your device.
- Free
- No sign-up
- Runs in your browser
- Sorted A to Z
- Lines
- 6 before, 6 after
- Characters
- 39 before, 39 after
How to use the Sort Lines Alphabetically
- Paste your list into Your lines, one item per line.
- Pick an Order: A to Z, Z to A, Shortest first, Longest first or Reverse.
- Adjust Options and Language rules if you need to, for example Remove duplicates.
- Check the counts under Result, then press Copy.
How do I sort a list alphabetically online?
Paste the list into the box with one item on each line. With A to Z selected, the sorted list appears next to it straight away and updates as you edit. The example pear, Banana, apple, item 10, item 2, cherry comes out as apple, Banana, cherry, item 2, item 10, pear. For a reverse alphabetical list, choose Z to A.
Shortest first and Longest first sort by the number of characters in each line, and lines of equal length are put in alphabetical order. Reverse does not sort at all: it flips the list so the last line becomes the first, which is useful for a log or a to-do list that was written newest-last.
How do I sort numbers correctly, so 2 comes before 10?
A plain alphabetical sort compares text one character at a time, so "item 10" comes before "item 2": the character "1" is smaller than "2". That is correct for letters and wrong for numbers. The option Numbers by value is on by default and tells the sorter to read each run of digits as a whole number, so "item 2" comes before "item 10", and "file9" before "file12". Turn it off to see the strict character-by-character order.
The option works inside a line, but it compares digits as written, so it is meant for numbered names, versions and file names. It does not understand signs, decimals or thousands separators: "1.5" and "1.25" are read as 1, 5 and 1, 25.
Does it ignore case, and what about accents and other languages?
With Ignore case on, "apple" and "Banana" sort by their letters alone, so capitals do not push words to the top. Turn it off and a lowercase letter sorts just before its capital: "a, A, b, B". Accents still count as differences either way, so "e" and "é" are not treated as the same letter.
Alphabetical order depends on the language. Swedish puts "å" after "z", while German treats "ä" as a variant of "a". The Language rules menu applies the rules of English, German, Swedish, Spanish, French or Turkish through your browser's built-in collation, and Browser default uses your device's own setting. The same list can therefore sort differently under different languages, which is expected, not a bug.
Remove duplicates drops repeated lines while it sorts, and respects the Ignore case setting. Remove blank lines and Trim spaces clean up the ends before sorting, so a stray leading space does not move a line to the top.
Use it with
- Remove Duplicate Lines: clean lists of repeated lines.
- Case Converter: UPPER, lower, Title, Sentence case.
- Bold Text Generator: bold and italic Unicode for social bios.
Questions
How do I sort Z to A?
Choose Z to A under Order. The list is sorted in reverse alphabetical order. Reverse, by contrast, simply flips the existing order.
How do I sort numbers so 2 comes before 10?
Keep Numbers by value ticked. Runs of digits are compared as whole numbers, so "item 2" comes before "item 10".
Does the sort ignore case?
Yes, when Ignore case is ticked, which it is by default. Untick it and a lowercase letter sorts just before the same capital letter.
Can I sort by line length?
Yes. Choose Shortest first or Longest first. Lines of the same length are ordered alphabetically.
How do I remove duplicates while sorting?
Tick Remove duplicates. Repeated lines are dropped before sorting, and the counts show how many were removed.
Why does Swedish sort differently from English?
Each language has its own alphabet order. In Swedish "å", "ä" and "ö" come after "z". Pick the language under Language rules to match your list.
How this page was made: the tool's results are computed in your browser by the code on this page; the explanations were drafted with AI help and checked against the tool's own output.