Sort Lines

Sort Mode

Tip: Natural sorting is usually best for filenames or values with numbers (e.g., file2, file10).

Direction & Uniqueness
Matching & Cleanup
Blank lines
Column sorting

Tip: default is TAB for pasted rows.

Original lines
12
Non‑empty (trimmed)
11
Unique (after options)
11
Output lines
11

Unsorted List

Sorted List

Alpha
apple
banana
éclair
Eclair
grape
img2
img10
orange
spaced
zebra
TL;DR — paste lines, pick a mode, copy/download sorted output

Drop in any list and this online line sorter instantly sorts it: natural (number‑aware) or lexical A→Z, by length, or by a specific column. Choose case/accent handling, dedupe, manage blanks, and export in one click. Fully client‑side.

Sort Lines — natural, lexical, length, and column sorting (client‑side)

Clean lists in seconds with a flexible line sorter. Choose Natural (number‑aware), Lexical (pure A→Z), sort by Length, or sort by a Column (set delimiter and 0‑based index). Toggle ascending/descending, optionally reverse after sorting, make comparisons case‑ or accent‑insensitive, trim lines, deduplicate, and control how blank lines are handled. The sorted output updates immediately and stays private — everything runs in your browser.

How to use this line sorter

  1. Paste your list: add lines to Unsorted List, or load a .txt file.
  2. Choose a sort mode: Natural (number‑aware), Lexical, Length, or Column (set delimiter + column).
  3. Refine options: ascending/descending, reverse after sort, case/accent‑insensitive, trim lines, unique only, and blanks policy (drop/keep/top/bottom).
  4. Copy or download: grab the Sorted List or save it as .txt.

Key features

  • Natural (number‑aware) and Lexical A→Z sorting
  • Sort by length (short → long) or by a specific column
  • Ascending/descending with optional post‑sort reverse
  • Case‑insensitive and accent‑insensitive comparisons
  • Trim lines, handle blanks (drop/keep/top/bottom), and keep unique lines only
  • Instant results with copy and .txt download
  • 100% client‑side — private and fast

Tips

  • Use Natural sort for filenames or IDs with numbers (e.g., file2, file10).
  • Turn on accent‑insensitive to treat é≈e in multilingual lists.
  • Sorting by column works great for CSV/TSV: set delimiter and column index.
  • Deduplicate after trimming and case‑folding to collapse near‑duplicates cleanly.

Frequently asked questions

What’s the difference between Natural and Lexical sorting?
Natural is number‑aware (so img2 < img10). Lexical is strict character comparison (pure A→Z).
Can I sort by a specific column?
Yes—choose Column mode, set a delimiter (comma, tab, pipe, etc.), and provide the 0‑based column index to sort by.
How do blanks and duplicate lines work?
Pick a blanks policy (drop/keep/top/bottom) and enable Keep unique lines only to deduplicate after normalization.
What does accent‑insensitive mean?
It treats diacritics as equivalent for sorting (e.g., ée), which is helpful for multilingual lists.
Is my data uploaded anywhere?
No—everything runs locally in your browser; nothing is uploaded.

Related tools

Remove Duplicate Lines · Advanced Text Cleaner · Reverse Lines · Find & Replace

Last updated: Aug 12, 2025