Text Sorter

Sort lines of text alphabetically, numerically, by length, or in reverse, for free.

How to use

  1. 1Paste lines of text, one per line.
  2. 2Choose a sort mode and options.
  3. 3Copy or download the sorted result.

Features

  • Alphabetical, numeric or length sorting
  • Ascending or descending order
  • Optional duplicate removal

Supported formats

Plain text

Privacy

Your text is sorted locally in your browser and is never sent to our server.

About this tool

The Text Sorter arranges lines of text alphabetically, numerically, or by line length, in ascending or descending order. The distinction between alphabetical and numeric matters more than it looks: alphabetical sort compares text character by character, so "10" sorts before "2" the same way "ab" sorts before "b" — numeric mode compares the actual value instead. Useful for organizing lists, spreadsheet columns pasted as text, or cleaning up log data before analysis. Combine it with Remove Duplicate Lines for a fully deduplicated, sorted list.

Frequently asked questions

Can I sort numbers correctly, not just alphabetically?

Yes, choose 'Numeric' to sort lines by their numeric value rather than as text (so 2 comes before 10).

Can I remove duplicate lines while sorting?

Yes, enable 'Remove duplicates' to drop repeated lines from the sorted result.

Is my text sent to a server?

No, sorting happens entirely in your browser.

Why would alphabetical sort put '10' before '2'?

Alphabetical sorting compares text character by character, so '10' comes before '2' because '1' comes before '2' — the same reason 'apple' comes before 'banana'. Switch to Numeric mode to sort by actual value instead, which puts 2 before 10 as you'd expect for numbers.