Sort lines online

Paste a list and sort it in one click: alphabetically, by length, or by the number that appears in each line. Numbers are ordered the way people expect.

  • Free
  • No sign-up
  • Runs in your browser
sort-lines

100% private — your text is processed in your browser and never sent to any server.

How it works

Paste your list

One item per line: names, words, file names, prices, dates or lines of a log.

Choose how to sort

Alphabetical, by line length, or by the number found in each line.

Copy the sorted list

Copy it back to your document or download it as a text file.

Sorting a list without a spreadsheet

Sorting a plain list should not require opening a spreadsheet, pasting the data into a column and remembering which button does what. This page sorts whatever you paste, one item per line, and gives you the result straight away. It is useful for name lists, keyword lists, file names, glossary entries, imports and exports, code such as CSS properties or dependencies, and any text where each line is an independent item.

Why "natural order" matters

A strict alphabetical sort puts item 10 before item 2, because it compares character by character and the character "1" comes before "2". That is rarely what you want. With natural order switched on, the numbers inside your lines are compared as numbers, so item 2 comes before item 10, and file names such as photo9.jpg and photo10.jpg end up in the order you expect. The sort also follows the rules of your language for accented letters, so a name starting with an accent is not thrown to the end of the list.

Sort by length or by the number in each line

Besides alphabetical order you can sort by line length, shortest or longest first, which helps when you look for unusually long entries in a list. You can also sort by the first number found in each line. That is handy for lines like "Ana, 34" or "$12.50 lunch": the tool reads the number and orders the lines by it. Lines that contain no number are placed at the end, and the tool tells you how many there were, so nothing disappears silently.

Tidy the list while you sort it

Three optional clean-ups run before sorting: remove blank lines, trim the spaces at both ends of every line and remove duplicate lines. You can compare lines ignoring capital letters, so Apple and apple count as the same entry when removing duplicates.

What it does not do

The tool sorts whole lines. If you paste a table with several columns it will sort by the beginning of each row, not by a column you choose, so copy only the column you want to sort. The number-based order reads the first number in a line and treats a comma followed by digits as a decimal separator, which is not right for thousands separators such as 1,250.

Frequently asked questions

How do I sort a list alphabetically?
Paste the list, leave "Alphabetical A → Z" selected and copy the result. Choose Z → A for reverse order.
Why does 10 come before 2 in some sorted lists?
Plain alphabetical sorting compares character by character, so "10" sorts before "2". Keep "Natural order for numbers" ticked and 2 will come before 10.
Can I sort lines by the number they contain?
Yes. Choose "Number in the line" and the lines are ordered by the first number found in each one. Lines without a number go to the end.
Does it handle accents and the letter ñ?
Yes. Sorting follows the rules of the page language, so accented letters and ñ are placed where a native speaker expects them.
Can I remove duplicates at the same time?
Yes. Tick "Remove duplicates". With "Ignore upper/lower case" on, lines that differ only in capitals count as duplicates.
Is my list uploaded anywhere?
No. The list is sorted in your browser and never leaves your device.