Skip to main content
CaseSwitch

Sort Words Alphabetically

Use the CaseSwitch Sort Words Alphabetically tool to order a bag of words or tags A–Z, with optional uniqueness and a delimiter you choose. Paste the list, set options, copy the sorted result. Sorting runs in this browser — nothing is uploaded.

Written by the CaseSwitch editorial team. We maintain these tools in the browser so drafts, keys, and images stay on your device.

Last reviewed: 23 July 2026

Processed locally in your browser. Nothing is sent to a server.

Paste or type text to convert. Output stays empty until there is input.

Character count: 0 · Word count: 0 · Line count: 0

Examples

Default case-insensitive sort

Input

zebra apple Banana

Output

apple Banana zebra

Unique on

Input

b a b a

Output

a b

Case sensitive sort on

Input

Zebra apple Banana

Output

apple Banana Zebra

Newline delimiter

Input

c b a

Output

a
b
c

Already sorted

Input

alpha beta gamma

Output

alpha beta gamma

How to use

  1. Paste words or tags separated by spaces or line breaks.
  2. Turn on Remove duplicates if you want a unique list; leave Case sensitive sort off for typical A–Z folds.
  3. Set Output delimiter to a space or a newline, then copy the result.

What this tool is for

Editors alphabetize index lists; developers want stable diffs of permission tags. This tool splits on whitespace, sorts with locale-aware `localeCompare`, optionally drops duplicates, and joins with your delimiter (default a space). It is a word-list sorter, not a sentence rewriter and not a CSV row parser.

How it works

Tokens come from `\S+` matches (whitespace-separated). Case sensitive sort defaults to off — comparisons use lowercased keys while original spellings are kept in the output order of the sort. Unique defaults to off; when on, first-seen spelling wins for a case-insensitive key (or exact key if case-sensitive). Delimiter defaults to a single space; use a newline for one word per line. Empty input yields empty output.

When to use it

Tag lists, glossary drafts, comparing two versions of a keyword set, preparing alphabetical credits, and stabilizing a permission list before diff.

When not to use it

Do not sort a prose sentence and expect grammar to survive. Do not sort personal names without a style rule for particles (da Vinci). Prefer the Duplicate Line Remover when you need first-seen order without alphabetical reordering.

How it compares to related tools

Number sorters order numeric values. The Duplicate Line Remover keeps first-seen order. The Duplicate Word Finder reports repeats inside prose. This tool’s job is alphabetical order of tokens.

Common mistakes

Leaving case-sensitive sort on and seeing “Zebra” before “apple” for the wrong reason — with case-sensitive on, uppercase and lowercase follow `localeCompare` on the raw strings. Sorting CSV rows as if they were words. Expecting punctuation-free tokens when commas were glued to words.

Case folding versus display spelling

With case-sensitive sort off, comparison keys are lowercased, but the token that appears in the sorted list keeps its original capitalization. That is why Banana can sit between apple and zebra. Unique mode uses the same key rules so “A” and “a” collapse when case-insensitive.

Delimiters and lists

A newline delimiter produces one token per line for easy paste into spreadsheets. Commas inside tokens are not treated as separators — only whitespace splits. If your source is comma-separated, replace commas with spaces first (Find and Replace) or split in a spreadsheet.

Frequently asked questions

How do I ignore case when sorting?+

Leave Case sensitive sort off (the default) so “Apple” and “apple” compare by letter.

Can I output one word per line?+

Set the output delimiter to a newline.

Does unique keep the first spelling?+

Yes. The first time a key appears, that exact token is kept; later duplicates drop.

Are commas separators?+

No. Only whitespace splits tokens. Replace commas first if needed.

Will this sort numbers naturally?+

Tokens sort as strings via localeCompare — “10” can sort before “2”. Use a number sorter for numeric order.

Is my list uploaded?+

No. Sorting runs in this browser.

Does CaseSwitch upload this text?+

No. Conversion, cleaning, and counting for this page run in your browser. Drafts are not sent to CaseSwitch for processing.

Related tools