Sort the lines in a list

Paste a list and sort it in natural, numeric, or dictionary order.

Choose a language and region, and remove blanks or duplicates if you want. Your browser does the sorting.

Your browser sorts your list

How to use

  1. Paste your list. Put one item on each line.
  2. Pick natural, numeric, or dictionary order. Then choose ascending or descending order.
  3. If you need to, choose a language and region and decide what to do with blanks, duplicates, and surrounding whitespace.
  4. Select “Sort,” then copy or download the result.

Examples to try

Sort file names in natural order

Input

file10
file2
file1

Output

file1
file2
file10

Sort numbers in the de-DE locale

Input

10,5
2,75
1.234,5

Output

2,75
10,5
1.234,5

Sort in Swedish dictionary order (sv)

Input

Öga
Zebra
Äpple
Ål

Output

Zebra
Ål
Äpple
Öga

Terms used in this tool

Natural order

Compare number parts by their values. For example, 2 comes before 10.

Dictionary order

Compare the lines as text. The order may depend on the language and region.

Locale

A locale sets the rules for sorting and formatting in a language or region. Pick one with a code such as ja, en, sv, or de-DE.

FAQ

When should I choose natural or dictionary order?

Natural order puts file2 before file10, the way you'd usually count. Dictionary order compares the names as text, so file10 can come first.

Can I sort numbers such as 1,234.56 and 1.234,56?

Yes. The tool uses the decimal and thousands separators for the language and region you choose. If it can't read a line as a number, it handles it using the setting you select for those lines.

Which language and region should I choose?

“Automatic” usually works. To sort or read numbers using another language or region, select “Custom” and enter a code such as ja, en, sv, or de-DE.

How does the tool decide which lines are duplicates?

By default, only identical lines count as duplicates. Choose “Use sort settings” to compare lines by your current case, accent, and number settings.

What happens to the list I paste?

Your browser sorts the text without sending it to a server.

Can I sort Japanese, Arabic, or European languages?

Yes. It uses Intl.Collator to compare text and reads numbers according to the language and region you pick. The exact order depends on your settings and your browser.

Notes

  • Numeric sorting reads decimal and thousands separators for the language and region you picked. Check that setting if the numbers aren't in the order you expect.
  • “Use sort settings” can treat lines that look different as duplicates.
  • You can save the settings on this device. The tool doesn't save your text or results.

Privacy and sorting

Your browser sorts the list on your device. The exact order can vary with your language and region settings and with the browser you use.