Text Sorter

Sort lines of text alphabetically, numerically, or by length with ascending/descending order and case options.

100% client-side No signup Free forever
// how to use

How to Use Text Sorter

  1. Enter or paste your text with one item per line
  2. Choose your sorting options (A-Z, Z-A, case sensitivity)
  3. Enable additional options like removing duplicates or empty lines
  4. Click "Sort Lines" to process your text
  5. Copy the sorted result
// features

Features

  • Alphabetical sorting (A-Z and Z-A)
  • Case-sensitive or insensitive sorting
  • Natural number sorting
  • Remove duplicate lines
  • Remove empty lines
  • Trim whitespace
  • Shuffle/randomize lines
  • Reverse order
// about

About Text Sorter

Organizing unordered lists, data exports, or collected items requires efficient sorting. Our Text Sorter arranges lines according to multiple criteria—alphabetical, numerical, or by length—with full control over sort direction and case handling.

Sorting Methods

  • Alphabetical A-Z: Standard dictionary order sorting
  • Alphabetical Z-A: Reverse alphabetical order
  • Numerical: Sort by numeric value (1, 2, 10 not 1, 10, 2)
  • By Length: Shortest to longest or longest to shortest
  • Random: Shuffle lines into random order

Case Sensitivity Options

In case-sensitive sorting, uppercase letters sort before lowercase ("Apple" before "banana"). Case-insensitive sorting treats A and a as equal, producing more intuitive results for most purposes. Choose the mode appropriate for your data—code identifiers often need case sensitivity while name lists typically don't.

Natural Number Sorting

Standard alphabetical sorting puts "item10" before "item2" because 1 comes before 2 character-by-character. Natural sorting recognizes embedded numbers and sorts them by value: item1, item2, item10. This produces the order humans expect for numbered items, file names, and version numbers.

// faq

Frequently Asked Questions

What sorting options are available?
Sort alphabetically (A-Z or Z-A), numerically (ascending/descending), by line length (shortest/longest first), by word count, or randomly (shuffle). Natural sorting handles numbers correctly: "file2, file10, file1" sorts to "file1, file2, file10" not "file1, file10, file2".
What is natural sorting vs alphabetical sorting?
Alphabetical sorting treats numbers as text: "1, 10, 2, 20, 3" (because "10" starts with "1" which comes before "2"). Natural sorting recognizes numbers: "1, 2, 3, 10, 20". Always use natural sorting for filenames, versions, or any numbered items.
Can I sort case-insensitively?
Yes! Case-sensitive sorting puts all uppercase before lowercase (A-Z, then a-z). Case-insensitive treats "A" and "a" as equal, interleaving them. Choose based on your needs - most text sorting should be case-insensitive unless technical sorting is required.
How do I sort CSV or tabular data by specific columns?
Paste CSV data and specify which column to sort by (column number or header name). You can sort by multiple columns in order of priority: first by column A, then by column B for ties. The entire row moves together, maintaining data integrity.
Can I reverse the order of lines without sorting?
Yes! "Reverse" mode flips line order without alphabetizing: first line becomes last, last becomes first. Useful for reversing chronological data, examining content backwards, or preparing data that was in the wrong order.
How do I remove duplicates while sorting?
Enable "Remove duplicates" along with sorting to get a unique, sorted list. You can also get unique items only (keep) or duplicates only (show what repeats). This combines two common operations into one step.