Sort Lines

Order the lines of any list the way you need: alphabetically, in natural order, by number or by length, ascending or descending.

  • Runs in your browser
  • Free, no sign-up
Sort by
Order
Ctrl + Enter also runs the tool

What this tool gives you

Four sort modes

Alphabetical, natural (numbers inside text sort by value), numeric and by line length.

Clean while sorting

Drop blank lines and duplicates in the same pass.

Locale aware

Accented characters sort where your language expects them, not at the end.

Frequently asked questions

What is natural sort?

It treats digit sequences as numbers, so file2 comes before file10. Plain alphabetical sorting would put file10 first because 1 is smaller than 2.

How does numeric mode handle text?

The first number found in each line is used for ordering. Lines without a number are treated as zero and stay near the start of an ascending sort.

Is the sort stable?

Yes. Lines that compare equal keep their original relative order, which matters when sorting by length or by a number shared by several lines.

Can I sort a CSV by one column?

Not directly. This tool sorts whole lines; for column-based sorting use a spreadsheet or a command-line tool such as sort -t, -k2.

From APIVoid

Need security checks inside your own product?

APIVoid turns the lookups you run here into developer-friendly JSON APIs: IP reputation, URL status and redirects, DNS lookups, SSL info, domain age, screenshots and much more. Simple pricing, 30-day free trial.