Skip to content

Sort Lines Alphabetically

Sort lines A–Z, Z–A, by number, or shuffle them.

  • Free
  • No sign-up
  • No watermark
  • Works in your browser

Also called: sort lines alphabetically, alphabetize list, sort text lines.

About Sort Lines

Sort a list one item per line: A to Z, Z to A, natural order (file2 before file10), by number, by line length, or shuffled at random. Numeric mode understands numbers with thousands separators, so 1,000 is sorted as one thousand rather than as 1. You can also ignore case, trim spaces and drop blank lines in the same step.

How to use Sort Lines

  1. Paste your list with one item per line.
  2. Choose the order: A–Z, Z–A, natural, number, length or random.
  3. Set options such as ignore case, trim spaces and remove blank lines.
  4. Press Sort and copy the result.

Tips and good to know

  • Alphabetical sorting is by character code unless you ignore case, so capital letters can come before lower-case ones.
  • Use numeric sort for prices, scores and IDs; use plain sort for names.
  • Natural order is best for names with numbers in them, such as file2 and file10, which plain A–Z would place the wrong way round.

How computers sort text

Simple alphabetical sorting compares characters by their code numbers, so capital letters may come before lowercase ones and “item10” before “item2”. Natural sorting reads numbers as numbers, putting item2 before item10. Accented letters and different languages have their own ordering rules, and case-insensitive sorting treats Apple and apple as equal. Sorting lists of names, keywords or file names before comparing them makes duplicates and gaps easy to spot.

Alphabetical is not always what you expect

Computers sort by character codes unless told otherwise, so plain sorting puts all capital letters before lower-case ones and puts “item10” before “item2”. Natural sorting fixes the number problem by comparing numbers as numbers, and case-insensitive sorting treats “apple” and “Apple” as neighbours. Accented letters are another trap: a language-aware sort places “é” next to “e” rather than after “z”.

Frequently asked questions

Can I remove duplicates while sorting?

Sort first, then use the Remove Duplicate Lines tool, which keeps each line once.

Is Sort Lines free?

Yes. Sort Lines is free: no sign-up, no paid plan, no trial and no limit on how often you use it. It runs in your browser, and ToolzAura is paid for by ads, so every tool stays free.

Are my files uploaded?

No. This tool runs in your browser, so your input stays on your device.

Maintained by Malik Shaheer · Last reviewed · How we test tools · Report a problem

Guides for Sort Lines

Related tools

Text Cleaner

Remove extra spaces, stray symbols and odd formatting.

Text Tools

Text Encryption and Decryption

Encrypt a message with a password and decrypt it later.

Text Tools

Text Repeater

Repeat a word or line a set number of times.

Text Tools

Citation Generator

Format a reference and in-text citation in APA, MLA or Chicago.

Text Tools

Essay Outline Builder

Turn your topic and main points into a ready essay outline.

Text Tools

LinkedIn Post Formatter

Format a post with bold, italic and spacing that LinkedIn displays.

Text Tools