Sort Lines

Paste a list with one item per line and get it sorted as you type. Natural order sorts numbers by value, so "Class 2" comes before "Class 10"; alphabetical order compares character by character; length order puts the shortest or longest lines first. Ignore case so "apple" and "Apple" sit together.

What to do
Sort by
Order
Your text
Result
Lines in
0
Lines out
0
Blank lines in
0
Longest line
0

Everything runs in your browser. What you type never leaves this device.

Features

  • Natural sort: item2 before item10, roll numbers in the right order

  • Alphabetical (character by character) for exact, code-style sorting

  • Sort by length, shortest or longest first

  • A-Z or Z-A, with ignore-case on or off

  • Equal lines keep their original order (stable sort)

  • Copy or download the sorted list

  • Runs in your browser: your text is never uploaded. Free, no signup

What people sort

Names and attendance lists

Put a class list, guest list or staff list in alphabetical order before printing.

Product codes and file names

Natural order keeps SKU-9 before SKU-10 and Chapter 2 before Chapter 11.

Keywords and tags

Sort by length to spot very short or very long keywords, or A-Z to scan a list for gaps.

Which sort order to pick

Natural, alphabetical or length

  • Natural reads runs of digits as numbers: 1, 2, 10, 20. Most people expect this for lists with numbers in them.
  • Alphabetical compares characters one by one, so "10" comes before "2" and, with case on, capitals come before small letters. Use it when you need the same order a program would use.
  • Length counts Unicode characters rather than storage units. Lines of equal length are then sorted naturally.

Blank lines and duplicates

Blank lines are sorted like any other line and end up at the top in A-Z order. Remove them first with Remove Empty Lines, or tick the options on the Text Cleaner. To sort and drop repeated lines at once, use Remove Duplicate Lines.

Other line tools

Sort Lines - FAQ