Skip to content

Free List Sorter - Sort Alphabetically & Numerically Online

Sort lists alphabetically or numerically, remove duplicates, and export as text or JSON. A free online tool for organizing names, numbers, and any data list.

List Sorter

Sorted List

Visualization

Loading calculator...
📚

Documentation

List Sorter

A list sorter is a tool that takes a block of text items, separated by a chosen character, and puts them in order. This one sorts lists alphabetically or numerically, can remove duplicate entries, and outputs the result as plain text or JSON.

How to sort a list online

  1. Type or paste the list into the input box.
  2. Set the delimiter, the character that separates one item from the next. The default is a comma.
  3. Choose a sort type: alphabetical for words, numerical for numbers.
  4. Choose a sort order: ascending or descending.
  5. Turn on "Remove Duplicates" if repeated entries should be dropped.
  6. Pick an output format, text or JSON.
  7. Copy the result.

How alphabetical sorting works

Alphabetical mode compares items as text, using locale-aware string comparison rather than a raw character-code comparison. This groups words by their letters first, so it handles accented characters correctly: "Zürich" and "São Paulo" sort where a fluent reader would expect them to.

Case is treated as a secondary rule. Two words that differ only in case, such as "apple" and "Apple", are grouped together, and the lowercase version is placed first. Numbers sorted this way are compared digit by digit as text, which is why "10" comes before "2": the character "1" is compared before "2" is ever reached.

Example. Input: banana, apple, cherry, apple, delimiter ,, ascending order, duplicates removed.

  • After removing the repeated "apple": banana, apple, cherry
  • Sorted ascending: apple, banana, cherry

How numerical sorting works

Numerical mode converts each item to a number and compares the numbers directly, so "2" comes before "10". Every item in the list is checked first. If even one item cannot be read as a number, the tool does not sort the list at all. It shows an error instead, and no result is produced. This applies even when only one item out of a long list is invalid.

Example. Input: 10, 2, 33, 4, ascending order.

  • Sorted ascending: 2, 4, 10, 33
  • Sorted descending: 33, 10, 4, 2

Example of the error case. Input: 10, apple, 3, numerical mode.

  • Result: no list is returned. The tool reports "Invalid numerical input" because "apple" cannot be converted to a number.

To sort a list that mixes letters and numbers, use alphabetical mode instead.

Removing duplicates

The "Remove Duplicates" option keeps the first time each item appears and discards the rest. It compares items as exact text, so it is case-sensitive: "Apple" and "apple" count as different items and both remain unless the list is lowercased first.

Delimiters

The delimiter tells the tool where one item ends and the next begins. Any text can be used as a delimiter, not just a single character. Common choices:

  • Comma (,) for data copied from spreadsheets or CSV files
  • Semicolon (;) for lists that already contain commas
  • A single space, for short word lists
  • A line break, for one item per line

If the sorted output looks like a single long item instead of a list, the delimiter usually does not match the input.

JSON output

Choosing JSON output wraps the sorted list in a JSON array, one string per item, for example ["apple", "banana", "cherry"]. Every entry is written as a quoted string, even in numerical mode: sorting 10, 2 numerically and exporting to JSON gives ["2", "10"], not the numbers 2 and 10. Programs that need actual numeric values should convert the strings after import.

Where a list sorter is useful

Alphabetical sorting suits contact names, product codes, and bibliography entries, which many citation styles require to be ordered by author surname. Numerical sorting suits prices, scores, and measurements. Removing duplicates helps clean up lists built by copying data from more than one source, such as merged spreadsheets or exported contact lists.

For very large datasets, a database with an indexed column, or a spreadsheet's built-in sort, will usually perform better than a browser-based tool. For sorting the same file repeatedly as part of an automated process, a command-line tool or a script is a better fit than a web page.

A short note on sorting algorithms

Sorting a short list and sorting a list of a million items both come down to the same idea: comparing pairs of items and arranging them in order. Efficient algorithms do this without comparing every possible pair. JavaScript's built-in Array.prototype.sort, which many browser-based sorters rely on, uses Timsort in V8, the engine behind Chrome and Node.js. Timsort is a hybrid of merge sort and insertion sort, written by Tim Peters for Python in 2002. Other browsers use different stable sorting algorithms; the JavaScript specification requires the result to be stable, meaning items that compare as equal keep their original relative order, but it does not require any particular algorithm.

Frequently asked questions

How do I sort a list alphabetically online? Paste the list into the input box, choose "Alphabetical" as the sort type, and pick ascending (A to Z) or descending (Z to A). The sorted list appears immediately.

Why did my numerical sort fail? Numerical mode rejects the whole list if any single item is not a valid number, rather than skipping the bad item. Check the list for stray letters, currency symbols, or extra spaces, and remove them, or switch to alphabetical mode if the list is meant to contain text.

Does the tool treat uppercase and lowercase letters as the same when sorting? For ordering purposes, yes: "apple" and "Apple" are grouped next to each other. For duplicate removal, no: they are treated as two different items unless the list is converted to one case first.

What delimiter should I use? Any character or short string that matches how the list is actually separated: a comma for CSV-style data, a semicolon if commas already appear inside the items, or a line break for one item per line.

Can I export the sorted list as JSON? Yes. The JSON output is an array of quoted strings in sorted order, for example ["2", "4", "10"] after a numerical sort. Values are not converted to native JSON numbers.

Is there a limit on how many items I can sort? The tool runs in the browser, so very large lists (tens of thousands of items and more) can slow down or strain available memory, depending on the device. For that scale, a database or a script is a more reliable choice.