The short answer. For a one-off, paste your list into the list alphabetizer — A→Z, dedupe, trim, natural sort, all in two clicks. In Word, select the lines and click the Sort button in the Paragraph group on the Home tab. In Excel, select the column and hit Sort A to Z, or use =SORT(A1:A100) on Excel 365. In Google Sheets, the equivalent is Data → Sort range or =SORT(A1:A100). In VS Code, open the Command Palette and run Sort Lines Ascending (the popular Sort Lines extension is the source). On the command line, the answer is just sort file.txt.
What does "alphabetical" actually mean?
Sorting feels obvious until you watch two tools disagree on the order. Three quirks are worth knowing before you pick a method:
- Lexicographic vs natural. A pure lexicographic sort treats every character as a character, so file10 comes before file2 — because
1is less than2. A natural sort treats embedded numbers as numbers, putting file2 first. Most desktop apps use lexicographic by default; the joinlines tool has a Natural mode for the cases where lexicographic is wrong. - Case. ASCII puts uppercase before lowercase, so Zebra would land before apple. Excel, Word, and the joinlines default all use a locale-aware compare that ignores case unless you ask for case sensitivity.
- Locale. Ä, ñ, å, and Chinese characters sort differently depending on the system locale. A Swedish locale puts Ä after Z; a German locale puts it next to A. Most browser-based tools (including ours) follow
Intl.Collatorusing your system locale.
How do you alphabetize a list in Microsoft Word?
Word has a dedicated sort dialog that handles bulleted lists, numbered lists, and plain paragraphs.
- Select the lines you want to sort. If you want the whole document,
Ctrl+A. - On the Home tab, find the Paragraph group. Click the Sort button — the icon is A over Z with a down arrow.
- In the Sort Text dialog, set Sort by to Paragraphs and Type to Text.
- Pick Ascending for A→Z or Descending for Z→A.
- Click Options if you need case sensitivity or a non-English collation language. Click OK.
A subtle gotcha: Word sorts paragraphs as a whole. To sort a list by the second word (say, by surname when the format is "First Last"), open Options, set the separator to Other with a space, then pick Word 2 in the Sort by dropdown.
How do you alphabetize a column in Excel?
Three reliable methods, in order of how much they leave the original data intact.
Sort & Filter button (in place).
- Click any cell inside the column you want to sort.
- On the Home tab, click Sort & Filter → Sort A to Z.
- If your data has headers and Excel asks, confirm Expand the selection so adjacent columns stay aligned with the sorted column.
This rewrites the original column. If you want to keep the source intact, use a formula instead.
SORT formula (Excel 365 / 2021 only).
=SORT(A2:A100)
The result spills into a fresh range. Add -1 as the third argument for descending order:
=SORT(A2:A100, 1, -1)
For older Excel versions without dynamic arrays, copy the column to a new sheet first, then use Sort & Filter.
Custom sort dialog — Data → Sort — gives you multi-key sorts (e.g. by Surname then by First Name) and case-sensitive sorting via the Options button. Worth the extra click whenever the data has more than one column you care about.
How do you alphabetize a list in Google Sheets?
Two options, identical in spirit to the Excel pair.
Data menu, in place.
- Select the range you want to sort (or click any cell inside a contiguous data block).
- Data → Sort range → Advanced range sorting options.
- Tick Data has header row if it applies, pick the column, choose A→Z, and confirm.
SORT formula (works on every version of Sheets).
=SORT(A2:A100)
Two extra arguments control direction and multi-column sorting:
=SORT(A2:C100, 2, TRUE)
That sorts the range by the second column (column B) ascending. Pass FALSE for descending. To break ties on a second key, append another pair: =SORT(A2:C100, 2, TRUE, 3, TRUE).
How do you sort lines in Notepad++ or VS Code?
Text editors handle one-off lists faster than a spreadsheet, because there's no row/column scaffolding to worry about.
Notepad++
- Select the lines (
Ctrl+Afor the whole file). - Edit → Line Operations → Sort Lines Lexicographically Ascending.
Other options in the same menu cover descending order, numeric sort (for lines that start with numbers), and case-insensitive sort. To dedupe at the same time, use the TextFX plugin or follow up with Edit → Line Operations → Remove Duplicate Lines.
VS Code
- Select the lines (
Ctrl+Afor all). - Open the Command Palette:
Ctrl+Shift+Pon Windows or Linux,Cmd+Shift+Pon macOS. - Type Sort Lines and pick Sort Lines Ascending.
The Sort Lines commands ship with the widely-installed Sort Lines extension by Tyriar — check Extensions if the command isn't there yet. Once installed, the extension also exposes Sort Lines (Natural), which fixes the file2 / file10 problem out of the box.
How do you sort a list from the command line?
On macOS, Linux, or WSL, the answer is one word: sort.
sort list.txt
The default is lexicographic ascending. Useful flags:
-r— reverse (Z→A).-u— sort and deduplicate in one pass.-f— ignore case.-V— natural / version sort (handles file2 before file10).-n— numeric sort, for lines that start with numbers.
Combine them freely:
sort -fu list.txt > deduped.txt
That sorts case-insensitively, removes duplicates (case-blind), and writes a clean file. On Windows without WSL, PowerShell has the equivalent:
Get-Content list.txt | Sort-Object -Unique | Set-Content sorted.txt
How do you alphabetize a list online, instantly?
Open the list alphabetizer. Paste your list. Pick a rule: A→Z, Z→A, by length, or Natural (numbers as numbers). Toggle Dedupe, Trim, or Case-sensitive as needed. Copy the result.
- Nothing uploads. The tool is a few hundred bytes of JavaScript that calls
Intl.Collatorin your browser. Open DevTools → Network and run a sort — you'll see zero outbound requests carrying your list. - Natural mode by default. No more file10 before file2. A toggle switches back to strict lexicographic if you need it.
- Dedupe is built in. No second pass needed. Case-blind by default; the Case-sensitive toggle keeps both Apple and apple if that matters.
- Locale-aware. Ä, ñ, å, Chinese characters all sort by your system collation.
In our tests, 100,000 lines sort in under a second on a modern laptop in Chrome. The upper bound sits around one million lines; the browser is the only ceiling because nothing leaves the tab.
Which method should you use?
| Where the list already is | Fastest method |
|---|---|
| A Word document or email draft | Word's Sort button in the Paragraph group |
| An Excel column with related columns next to it | Sort & Filter (in place) or Data → Sort for multi-key |
| A Google Sheet with formulas downstream | =SORT() in a new column to preserve the original |
| Open in Notepad++ or VS Code | Built-in or extension Sort Lines command |
| One-off list pasted from somewhere | Browser tool |
| Filenames or version strings (file2 vs file10) | Browser tool in Natural mode, or sort -V |
| 1 GB log file, scripted batch | sort on the command line |
| Privacy matters | Browser tool or terminal — never an upload-based site |
Frequently asked questions
Why does my sort put "file10" before "file2"?
Because the default sort is lexicographic — it compares character by character. The character 1 is less than 2, so file10 wins before the comparison ever reaches the zero. Switch to a natural / version sort: Natural mode in the browser tool, sort -V on the command line, or the Sort Lines (Natural) command in the VS Code Sort Lines extension.
How do I alphabetize and remove duplicates at the same time?
Three short paths. (1) In the browser tool, leave Dedupe on (it's the default). (2) On the command line, sort -u file.txt. (3) In Excel, sort first, then Data → Remove Duplicates. Avoid the Word route — Word can sort but it has no dedupe.
Why are uppercase letters sorted before lowercase in some tools?
Because the tool is using ASCII / byte order, where every uppercase letter has a lower code point than its lowercase counterpart. To fix this, ask for a case-insensitive sort: Options → uncheck Case-sensitive in Word, default behaviour in Excel and Google Sheets, sort -f on the command line, or the Case-sensitive toggle off (default) in the browser tool.
How do I sort by last name when the list is "First Last"?
In Word: open the Sort dialog → Options → set separator to a space → Sort by → Word 2. In Excel: split the column with Text to Columns (or formula), then sort by the surname column. In a flat text editor or browser tool: pre-process the list so each line starts with the last name — e.g. swap "Ada Lovelace" to "Lovelace, Ada" before sorting.
Can I sort non-English text correctly?
Mostly, yes — but the right answer depends on the locale. Ä sorts after Z in Swedish but next to A in German. Most browser tools (including the joinlines alphabetizer) use Intl.Collator with your system locale, so the order follows your OS settings. Spreadsheet tools follow the file's locale. For a hard guarantee, sort on a machine with the locale you want.
What's the fastest way to alphabetize a million-line list?
Command line, by a wide margin. sort big.txt > sorted.txt uses an external-memory merge sort and streams straight from disk. Excel will struggle past about a million rows (its documented sheet limit). The browser tool handles a million lines — that's the tested ceiling on the SORT page — but for files heavy enough that pasting them itself starts to lag, the clipboard becomes the bottleneck before the sort does.
— the joinlines team, 2026-04-24