Avexora Tools

Text Sorter

Free text sorter. Sort lines A to Z, Z to A, by length, or in natural numeric order (file2 before file10), with optional case-insensitive sorting.

About the Text Sorter

A text sorter that orders lines A→Z, Z→A, by length, or in natural numeric order — so file2 sorts before file10 — with stable, case-insensitive sorting by default.

Paste your list here, pick an order, and it's sorted — alphabetically, by length, or in natural numeric order. Sorting a list sounds trivial until you actually need it done: names for an invitation list, product codes for a catalogue, keywords for an SEO sheet, package names in a config file that a linter insists must be alphabetical. Spreadsheets can sort, but pasting a list into a column, sorting, and copying it back out is five steps for a one-step job.

Beyond the obvious A-to-Z and Z-to-A, two orders earn their place. Natural sort handles numbers inside text the way humans expect: plain alphabetical sorting puts item10 before item2 (because "1" < "2" character-wise), while natural sort reads the digits as numbers and orders item2, item10, item100 correctly — indispensable for file names, version numbers and SKU lists. Length sorting, shortest or longest first, is the quiet favourite of copywriters arranging headline options and developers ordering CSS class names or import lines.

Case-insensitive mode (on by default) prevents the classic surprise where all capitalised words sort before every lowercase word — with it on, "apple" and "Banana" order as a human would file them. The sort is stable: equal lines keep their original relative order. Everything runs locally in your browser, and the result is one click from your clipboard or a downloadable text file. Pair it with the duplicate-line remover before sorting for clean, deduplicated, ordered lists in seconds.

How to use the Text Sorter

  1. Paste the lines you want to sort into the box.
  2. Pick the sort order: A→Z, Z→A, natural numeric, shortest first or longest first.
  3. Decide whether to ignore case (on by default for dictionary-style order).
  4. Click Sort to rearrange the lines.
  5. Copy the ordered list or download it as a text file.

Worked example

using Natural sort on 'file10, file2, file1' returns 'file1, file2, file10' instead of standard alphabetical order.

Frequently asked questions

What is natural sort order?
An order that treats digit runs as numbers: file2 comes before file10, version 1.9 before 1.10. Plain alphabetical sorting compares character by character and gets these wrong.
Why do capitalised words sort first without case-insensitive mode?
Character codes for capitals (A–Z) come before lowercase letters (a–z), so a case-sensitive sort puts "Zebra" before "apple". Case-insensitive mode compares lowercase versions, giving the dictionary-style order people expect.
Can I sort numbers?
Yes — use natural order so 9 sorts before 82 and 100. Alphabetical order would sort them as strings: 100, 82, 9.
What does sorting by length do?
It orders your list based purely on the number of characters in each line, which is useful when organizing CSS classes or visual text layouts.
Does sorting remove duplicate lines?
No, sorting will just group duplicates together. If you want to remove them, use the Remove Duplicate Lines tool first.

More from Avexora

All Avexora products →

Business software from the team behind these free tools.

Get one practical business tip every week

Tools, templates and tactics for running your business — free, no spam.

Related tools

More text & data tools