ScriptMonsters
Free online text case converter and utility tools

Sort Text Alphabetically

Paste a list and instantly sort the lines from A to Z or Z to A, with options to remove duplicates, ignore case and strip blank lines.

5 lines · 1 blank line removed

How to use the Sort Text Alphabetically

  1. Paste your list into the input box — one item per line.
  2. Choose an order: A→Z, Z→A, reverse the current order, or shuffle randomly.
  3. Tick any options you need: ignore case, remove duplicate lines, remove blank lines, trim spaces or sort by last word.
  4. Pick how the output is separated — line breaks, commas, semicolons, spaces or pipes.
  5. The sorted list updates instantly — click Copy to Clipboard or Download to save it.

Examples

InputOutputNotes
banana Apple cherryApple banana cherryA→Z, case-insensitive (default).
banana Apple cherrycherry banana AppleZ→A order.
item2 item10 item1item1 item2 item10Natural number order keeps item10 after item2.
red blue red green blueblue green redA→Z with "remove duplicate lines" on.
Ada Lovelace Grace Hopper Alan TuringGrace Hopper Ada Lovelace Alan Turing"Sort by last word" orders by surname (Hopper, Lovelace, Turing).

What does sorting text alphabetically mean?

Alphabetical sorting reorders a list so each line follows dictionary order — A before B, B before C, and so on. This tool works line by line: paste any number of items separated by line breaks and it returns them in order, either ascending (A→Z) or descending (Z→A).

It also handles the jobs that usually go with alphabetising a list: removing duplicates, deleting blank lines, trimming stray spaces, and comparing numbers by value.

Options explained

OptionEffect
A→Z / Z→AAscending or descending alphabetical order.
Reverse linesFlips the current order without sorting — last line becomes first.
ShuffleRandomises the line order.
Case sensitiveWhen on, uppercase and lowercase sort separately (Unicode order).
Natural number order"file2" before "file10" instead of after.
Remove duplicate linesKeeps only the first copy of each line.
Remove blank linesDrops empty lines before sorting.
Trim whitespaceStrips leading/trailing spaces from every line.
Sort by last wordOrders by the final word of each line (surname sorting).
Separate output byJoin the sorted items with line breaks, commas, semicolons, spaces or pipes.

Who uses an alphabetical sorter?

  • Students and writers ordering bibliographies, glossaries and reference lists.
  • Teachers alphabetising class name lists.
  • Developers sorting config keys, import statements, translation strings and word lists.
  • Marketers and SEOs tidying keyword lists and de-duplicating them.
  • Data entry teams normalising exported lists before import.

Tips

To change the capitalization of the sorted list, run it through the Text Case Converter afterwards. To count how many unique items you ended up with, paste the result into the Word Counter. For turning a sorted list into URL slugs, use the URL Slugify Generator.

Frequently asked questions

How do I sort a list alphabetically online?

Paste your list into the box above with one item on each line, then click A→Z. The lines are reordered alphabetically straight away and you can copy or download the sorted list. No sign-up and no limit on how many lines you paste.

Does it sort by whole lines or by words?

By default each line is treated as one item and the whole line is compared. Turn on "sort by last word" to order by the final word of each line — handy for alphabetising names by surname.

Can it remove duplicate lines?

Yes. Enable "remove duplicate lines" and every repeated line is dropped, keeping only its first occurrence. Combine it with "ignore case" so that "Apple" and "apple" count as the same entry.

What does "natural number order" do?

It compares embedded numbers by value rather than character by character, so "item2" sorts before "item10" instead of after it. Turn it off for a strict character-code sort.

Is capitalisation taken into account?

Only if you tick "case sensitive". With it off (the default) upper- and lowercase letters are mixed together alphabetically. With it on, the sort follows Unicode order, which groups differently.

Can I get the sorted list as a comma-separated line instead of one item per line?

Yes. Use the "separate output by" menu to join the sorted items with commas, semicolons, spaces or pipes instead of line breaks — useful for pasting a list into a spreadsheet cell, a SQL IN () clause or a CSV field.

Is my text uploaded anywhere?

No. All sorting happens in your browser with JavaScript, so your list never leaves your device — safe for private or unpublished content.

Related searches

sort text alphabeticallyalphabetical order toolsort list alphabetically onlineput words in alphabetical orderline sorter onlinesort text a to zsort text z to aremove duplicate lines and sort

Related tools