Sort Lines Online

Sort text alphabetically, naturally, numerically, or by length. Cleanup changes are listed separately, and your text stays in your browser.

How to sort lines

Paste one item per line and choose the mode that matches the data. A to Z and Z to A compare text, Natural recognizes numbers inside names, Numeric compares whole decimal or scientific-notation values, and Length orders lines by Unicode code point count. Ties keep their original order. Optional cleanup runs before sorting.

Sorting and cleanup are different

Changing order does not alter line content, so it is not counted as a cleanup change. Trimming whitespace, dropping blank rows, and removing duplicate values are listed in Change review with the original line number and reason.

This separation is useful when a sorted result has fewer lines than the source. You can confirm whether the difference came from blank rows, duplicates, or both before copying it.

Choose the right sort mode

  • A to Z: names, labels, domains, and ordinary text.
  • Natural: filenames and identifiers such as file2 and file10.
  • Numeric: whole values such as 2, 10.5, and 4e2. Blank and nonnumeric lines stay in their original order at the end.
  • Length: shortest to longest by Unicode code point count. A combining mark counts separately from the letter it modifies.

Example

banana
Apple
file10
file2
Apple
banana
file2
file10

FAQ

What is natural sort?

Natural sort handles embedded numbers in a human-friendly way, so file2 comes before file10.

Can I remove duplicates while sorting?

Yes. Turn on Remove duplicates before copying the sorted output.

Can I reuse the same settings?

Yes. Copy settings link creates a URL containing the selected mode and options, but never your pasted text.

Is the text uploaded?

No. Sorting happens locally in your browser.