Sort Lines

Sort Lines

Sort text lines alphabetically, naturally by embedded numbers, or by grapheme length. Choose direction and optionally remove exact duplicate lines.

Input and results are processed in your browser. This tool does not send or save their contents to a server. Shared site advertising, visitor analytics, and aggregate tool-use measurement may operate separately.

Comments & questions

Sort Lines

Reorder lists with one item per line. Natural sorting places item2 before item10 while preserving each item’s text.

Key features

  • Choose language-aware, natural-number, or grapheme-length sorting.
  • Use ascending or descending order with stable ordering for equal values.
  • Optionally remove exact duplicates without trimming line contents.

How to use

  1. Paste a list with one item on each line.
  2. Choose the comparison, direction, and duplicate handling.
  3. Run the sort, review the result, and copy it.

Use cases

  • Organize numbered filenames
  • Review alphabetized word lists
  • Put short messages first in a review queue

Frequently asked questions

What is natural sorting?

It compares embedded digit runs numerically: item2 comes before item10. Alphabetical mode treats digits as text.

Are spaces removed?

No. Spaces remain part of each line and its comparison value. Lines with different spacing are not exact duplicates.

How is length measured?

Length uses Intl.Segmenter grapheme clusters, keeping supported emoji sequences and combining characters together.

What happens to blank lines?

Real blank lines are sorted too. Exact deduplication merges repeated blank lines. Line endings become LF, while the presence of a final newline is preserved.

Privacy

Input and results are processed in your browser. This tool does not send or save their contents to a server. Shared site advertising, visitor analytics, and aggregate tool-use measurement may operate separately.

Related Tools

Explore all Text/Convert tools →Image/Media →Life/Fun →Dev Tools →