Sort Lines Alphabetically
Writing ToolsPaste lines and sort them A–Z, Z–A, by length, naturally or randomly, as you type.
Processed in your browser. A copy of each run is saved to your past runs so you can reopen it. Privacy
About
What the Sort Lines Alphabetically does
Sort Lines puts a list into alphabetical order as you type. It sorts A to Z or Z to A with English rules, so accented letters fall in the right place, and can sort by length or shuffle. Natural sorting puts Item 2 before Item 10, leading articles such as The can be ignored, duplicates can be removed, and CSV lines can be sorted by one column.
Steps
How to use it
- 1Paste the lines or upload a text or CSV file.
- 2Pick the order and any options, such as Ignore The, A, An.
- 3Copy or download the sorted list.
Example
A real run
Input
The Road A Tale of Two Cities Dracula The Great Gatsby Beloved An American Tragedy The Hobbit Middlemarch
Output
An American Tragedy Beloved Dracula The Great Gatsby The Hobbit Middlemarch The Road A Tale of Two Cities
With Ignore The, A, An on, The Great Gatsby files under G and A Tale of Two Cities under T, the way a library catalog orders titles.
Options
Every setting, and when to use it
- Order
- A → Z and Z → A sort alphabetically. Shortest first and Longest first sort by length, useful for tidying keyword lists. Random shuffle picks a new random order each time, for drawing names or mixing test data.
- Natural numbers
- On, numbers inside lines sort by value, so Chapter 2 comes before Chapter 10. Off, lines compare character by character, which puts 10 before 2.
- Ignore The, A, An
- Sorts titles the way libraries and bookshops do: The Hobbit files under H. The articles stay in the output; they are only skipped when comparing.
- Sort by column and Keep first line on top
- For CSV or tab-separated lines, enter a column number to sort by that field. Keep first line on top leaves a header row in place.
Good to know
Common problems and limits
Up to 10 MB or 1,000,000 lines. Sorting follows US English rules: case is ignored unless Uppercase first is on, and é sorts next to e.
Lines are sorted, not words within a line or paragraphs of a document; to sort paragraphs, first put each on one line with Remove Line Breaks.
To drop repeated lines without sorting, use Remove Duplicate Lines.
Audience
Who uses it
- Writers and editorsAlphabetize a bibliography, a glossary, a list of names or a set of tags.
- DevelopersSort import lines, environment variables, dependency lists or config keys before committing.
- Teachers and organizersPut a class roster in order, or shuffle names to pick presentation order fairly.
FAQ
Frequently asked
How do I sort lines alphabetically in Word or Google Docs?
In Word, select the lines and use Home, Sort (the A-Z button), then choose Paragraphs and Text. Google Docs has no built-in sort; paste the lines here, sort them, and paste them back.
How do I sort a list alphabetically in Excel?
Put one item per cell in a column, select it and use Data, Sort A to Z. For lines pasted from elsewhere, this page is quicker and handles natural number order and leading articles.
What is the difference between natural and alphabetical sort?
Alphabetical sort compares characters one by one, so file10 comes before file2 because 1 is less than 2. Natural sort reads the numbers as numbers, giving file2 before file10, which is what people expect for chapters, versions and file names.
Why do uppercase letters sort first in some tools?
Simple tools sort by character code, and in ASCII every capital letter (A–Z) comes before every lowercase letter (a–z), so Zebra lands before apple. This page ignores case by default; turn on Uppercase first to put capitals ahead when two lines differ only in case.
Can I sort in reverse alphabetical order?
Yes, choose Z → A. Every other option, such as natural numbers or ignoring articles, still applies.
Is my list sent anywhere?
No. Sorting happens in your browser. A copy of each run is saved to your past runs so you can reopen it.
Automation: an MCP tool sort_lines(text, options) → text and an n8n node are planned for this tool.