Text Tools

Text Sorter

Paste a list of lines and sort them alphabetically, by length, or numerically, in ascending or descending order.

Advertisement space

How Text Sorter Works

The tool splits your text into lines and reorders them using the rule you choose. Alphabetical sorting compares lines as text, case-insensitively. Length sorting compares the number of characters in each line. Numeric sorting parses each line as a number and compares the numeric values, which is useful for sorting things like prices or IDs that aren't in plain alphabetical order.

How to Use This Tool

  1. Paste your list into the input box, one item per line.
  2. Choose whether to sort alphabetically, by length, or numerically.
  3. Pick ascending or descending order.
  4. Select Sort and copy the reordered list.

Example

Sorting "10\n2\n33" numerically (ascending) gives "2\n10\n33", while alphabetical ascending sorting of the same list gives "10\n2\n33" because "1" comes before "2" and "3" as text.

Helpful Tips

  • Use numeric sort for lists of numbers — alphabetical sort compares digit-by-digit as text and will put "10" before "2".
  • Lines that aren't valid numbers are treated as 0 in numeric mode, so mixed text-and-number lists may need cleaning first.
  • Length sorting is handy for finding the shortest or longest entries in a list of names, tags or URLs.

Frequently Asked Questions

Is alphabetical sorting case-sensitive?
No, alphabetical sorting compares lines case-insensitively, so "Banana" and "banana" are treated as equal for ordering purposes.
What happens with numeric sort if a line isn't a number?
Any line that can't be parsed as a number is treated as 0, so non-numeric lines will cluster at the low end in ascending order.
Can I sort a list of prices with dollar signs?
Not directly — numeric sort looks for a valid number at the start of the line, so a prefix like "$" may prevent correct parsing. Remove currency symbols first for accurate results.
Does sorting remove duplicate lines?
No, sorting only reorders lines; duplicates are kept. Use the Remove Duplicate Lines tool first if you also want duplicates removed.

This tool runs entirely in your browser. Your input is not uploaded to any server.