Skip to content

Sort Lines A–Z

Put any list into alphabetical order, numbers handled properly.

Quick Tool Overview

Sort Lines A–Z puts a list into alphabetical order using natural number handling, so "item 2" comes before "item 10" rather than after it, and locale-aware comparison, so accented letters sort where a reader expects. Duplicates can be removed in the same pass.

What it does
Sorts lines into alphabetical order
You give it
A list with one item per line
You get back
The sorted list, with duplicates optionally removed
Best for
Names, tasks, keywords, filenames and reference lists
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Sort Lines A–Z

Alphabetical sorting sounds simple until a list contains numbers. A plain sort puts "item 10" before "item 2", because it compares character by character and 1 comes before 2. Natural sorting — the kind file managers use — reads the digits as a number and gets it right.

This sorter uses natural ordering by default and handles accented letters correctly, so "Ångström" sorts where a reader expects rather than at the end. Case can be ignored or respected, leading whitespace can be ignored so indented lists sort by content, and duplicates can be removed in the same pass. Blank lines are dropped rather than being sorted to the top, which is what nearly everyone wants.

Key features of the Sort Lines A–Z

Natural number ordering

Item 2 sorts before item 10, because consecutive digits are read as a number rather than compared character by character.

Accents sort correctly

Locale-aware comparison puts "Ångström" near A instead of after Z, which a code-point sort never does.

Case folding

Ignore case so "Zebra" does not sort before "apple", which is what a raw sort produces.

Duplicates removed in one pass

Sort and de-duplicate together, with a count of what was removed.

Blank lines dropped

Empty lines are removed rather than gathered at the top, which is what a sorted list should look like.

How to use the Sort Lines A–Z

  1. 1

    Paste your list

    One item per line — names, tasks, keywords, filenames or anything else.

  2. 2

    Choose the comparison

    Natural ordering for lists containing numbers, or strict character ordering when you need it.

  3. 3

    Set the extras

    Ignore case, ignore leading spaces and remove duplicates as part of the same sort.

  4. 4

    Copy the sorted list

    Copy the result or download it, with a count of duplicates removed.

Frequently asked questions

Because a plain sort compares character by character, and the character "1" comes before "2". Natural ordering reads consecutive digits as a single number, which puts item 2 first. This tool uses natural ordering by default.

Reviews of the Sort Lines A–Z

What people who use the Sort Lines A–Z think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Sort Lines A–Z. It takes half a minute and no account.

Write the first review

More text tools