Sort Lines

Paste a list (one item per line) and sort it instantly. Choose Natural (number-aware) or Lexical sorting, sort A→Z or Z→A, sort by length, or sort by a specific column (CSV/TSV). Trim lines, dedupe, and control blank-line behavior. Everything runs locally in your browser.

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 – Alphabetically Sort Text Lines Online Free

Sort text lines alphabetically, by length, or by column value online. This free line sorter supports natural (number-aware) and lexical A→Z sorting, deduplication, case/accent-insensitive comparison, and CSV/TSV column sorting.

Natural sort vs. alphabetical sort

Natural sort treats embedded numbers numerically (file2 < file10 < file100), giving results that match human expectation. Alphabetical (lexical) sort treats everything as characters, so file10 < file2 < file20.

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.
How do I sort a list of words alphabetically online for free?
Paste your list (one word or item per line) and choose Lexical or Natural sort mode. The sorted output appears instantly. Copy or download as .txt. No sign-up required.
How do I sort lines in a text file online?
Paste or upload your text file, select a sort mode (Natural, Lexical A→Z, Length, or Column), and the lines are sorted immediately. Download the result as a .txt file.
How do I sort and remove duplicates from a list online?
Enable Keep unique lines only along with your chosen sort mode. The tool sorts the list and removes duplicate entries in one step.

Related tools

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