Skip to main content

Free Text Line Sorter – Sort Alphabetically & More

Sort text lines alphabetically, numerically, by length, or randomly online for free. Remove duplicates while sorting.

Written & reviewed by Helperzy Editorial Team · Updated July 2026

8 Sort ModesRemove DuplicatesReal-timeNo UploadFree

Input (one item per line)

0 lines

Sorted Output

0 lines

100% Private

All sorting happens locally in your browser.

How to Use Sort Text Lines

1

Enter Lines

Paste your list with one entry per line. Names, numbers, keywords and config lines all work, and there is no row limit since sorting happens on your device.

2

Choose Sort

Pick a mode, using a numeric one whenever your lines are numbers so 10 does not land before 2. Add remove duplicates and remove empty lines to clean the list in the same pass.

3

Copy Result

Check the first and last few lines to confirm the order is what you expected, then copy or download the output for your document, spreadsheet or config file.

What Sorting Text Lines Does and How Each Mode Orders Them

This reorders the lines of a block of text without you dragging anything around. Eight modes are available: A to Z, Z to A, numeric ascending, numeric descending, shortest line first, longest line first, random shuffle, and simple reversal of the current order. You paste one item per line, pick a mode, and read the result. It gets used for alphabetising name lists and glossaries, tidying keyword exports, ordering config entries, arranging vocabulary for a class handout, and drawing names at random. Two optional cleanups run in the same pass: drop empty lines, and drop duplicates. Understanding the difference between the alphabetical and numeric modes saves the most grief. Alphabetical sorting compares strings character by character using their character codes, so it decides that 10 comes before 2, because the character 1 is lower than the character 2. Numeric sorting parses each line into an actual number and compares values, putting 2 before 10 as any human would. Length sorting counts characters per line, ignoring content entirely. Shuffle uses a random pass over the array, producing a different arrangement each time. Reverse does no comparison at all — it simply inverts whatever order you already had, which is why it is the right choice for flipping a changelog rather than re-sorting it. Case sensitivity matters too: in raw character-code order every capital letter sorts before every lower-case letter, so Zebra lands ahead of apple unless case-insensitive comparison is used. A worked example makes it concrete. Take five lines: 2, 10, 9, 100, 21. Sort them A to Z and you get 10, 100, 2, 21, 9 — correct by character code and useless as a number list. Sort the same five numerically ascending and you get 2, 9, 10, 21, 100, which is what you actually wanted. Now try a mixed-case list: Zebra, apple, Mango. Case-sensitive A to Z returns Mango, Zebra, apple, because both capitals sort ahead of the lower-case a. Case-insensitive A to Z returns apple, Mango, Zebra. Same input, and the option you tick decides whether the output makes sense. Specific situations. A librarian alphabetises a 240-entry bibliography pasted out of a document. An SEO consultant sorts a keyword export by length to find the long-tail phrases quickly. A teacher shuffles a list of 32 pupil names to assign presentation slots without argument. A developer sorts the lines of an environment file alphabetically so a diff against another environment is readable. A shop owner sorts a stock list numerically by SKU, having first discovered that alphabetical order put item 100 between 10 and 2. A wedding planner sorts a 180-name guest list alphabetically so the seating chart can be checked against RSVPs without scanning the whole sheet twice for every table on the night. Enable remove duplicates and remove empty lines together when your list came from more than one source, so you clean and order in a single pass rather than three. The pitfall almost everyone hits at least once is using alphabetical mode on numbers and not noticing until later — if your list is numeric, always pick a numeric mode, even when the numbers happen to be the same width today. Mixed-case and accented text is the second trap, since character-code order rarely matches dictionary order for names like Ángela or names entered inconsistently. Check the first and last few lines of the output as a sanity test. Shuffle also destroys any ranking your list carried, so copy the original somewhere first if there is any chance you will need that order back later. Sorting runs in your browser, so contact lists and private data are never uploaded, stored or logged.

Example: Sort Text Lines

Input

Five lines: 2, 10, 9, 100, 21

Result

A to Z: 10, 100, 2, 21, 9 · Numeric ascending: 2, 9, 10, 21, 100

Alphabetical mode compares character codes, so the line starting with 1 sorts before the line starting with 2; numeric mode parses each line as a value and orders them 2, 9, 10, 21, 100 as expected.

Frequently Asked Questions – Sort Text Lines

Yes. Use the numerical sort mode, either 0 to 9 or 9 to 0, which orders the lines by their actual numeric value rather than alphabetically. This means '10' correctly comes after '9' instead of landing right after '1' the way character-based sorting would place it.