Skip to content
Text

Sort lines alphabetically, by length or naturally

Put a list in alphabetical order, sort filenames with numbers, or move the last line to the top. Natural order puts file2 before file10; the length options help bring the shortest or longest entries together.

Runs in your browser — your input is not uploaded to ToolsNow.

Your list
0 chars0 words0 lines
Sorted lines
0 chars0 words0 lines

How to use

  1. Paste one item per line. Each whole line moves as one entry; columns within a line are not sorted separately.
  2. Choose Sort order. Try Natural (file2 before file10) for numbered names, or Reverse current order to flip the list without alphabetising it.
  3. Set the list options. Choose Case sensitive, Keep blank lines or Also remove duplicates as needed. Check the order, then copy or download the result.

Questions

When should I choose natural order?

For names with numbered parts: file1, file2 and file10. A → Z treats the digits as text and puts file10 before file2. Natural order compares digit runs numerically; it is not a parser for dates, currencies or spreadsheet columns.

Will accents sort the same on every device?

Not necessarily. Alphabetical and natural sorting use the browser’s locale rules, so accented letters can fall in different places under different language settings. Review the result if you need a specific dictionary order.

Can I remove repeats while sorting?

Yes. Also remove duplicates keeps the first matching line before sorting. Comparison ignores spaces at the ends, and follows the Case sensitive setting; the kept line’s text stays as entered.

Is Shuffle randomly suitable for a prize draw?

No. It uses a repeatable pseudo-random sequence, not cryptographic randomness. It is useful for rearranging a practice list or changing a reading order. Shuffle again changes the sequence, but does not guarantee a different result for a short list.

What does sorting by length count?

It includes spaces in each line and measures JavaScript string length. An emoji can take more than one string position, so this is not always the same as the number of visible characters.

Examples and checks

Put one item on each line. Choose A–Z for words, natural order for numbered filenames, or length to bring the shortest or longest entries to the top.

Order numbered files

Input or situation
file10 file2 file1
Result
file1 file2 file10

Natural order reads the digit sequences as numbers. Ordinary A–Z ordering puts file10 before file2.

Before you use the result

Published by ToolsNow. How tools and sources are checked · Report a problem

Related tools