FREE WEB TOOL

Line sorter

Sort lines ascending, descending, or by length, with optional natural ordering, locale, sensitivity, trimming, blank-line removal, and deduplication.

Use tool

Your input is processed in your browser and is not sent to our server.

How to use this tool

Sort lines ascending, descending, or by length, with optional natural ordering, locale, sensitivity, trimming, blank-line removal, and deduplication.

  1. Set Text, Sort order.
  2. Use Sort to process the input.
  3. Compare the result with your source data and return to the input to make corrections.
Sort order
Ascending / Descending / Shortest first / Longest first

Input and settings example

banana apple → Ascending: apple / banana

Sorting is line-based. Note the distinction between text order and numeric order.

What to know before using it

Values such as item2 and item10 often sort unexpectedly as plain strings. Natural sort treats numeric runs numerically; locale rules affect case and language-specific collation.

Common failure points

  • Trimming whitespace before sorting can change order.
  • If deduplicating at the same time, verify which occurrence is kept.
  • Machine identifiers may be better served by strict lexical order.

Practical example

Use natural order for filenames, lexical order for codes, and locale-aware order for human names.