Free · No sign-up · Nothing uploaded

Sort Lines of Text Online

Paste any list or block of text and re-order it alphabetically, by line length, or in reverse. Works with keyword lists, meeting notes, log lines, CSV rows, and anything else where line order matters. Sort is done in your browser — nothing is sent to a server.

🔒 Your text is processed locally in your browser and never uploaded. We do not upload or store your text.

  1. 1 Paste your text
  2. 2 Choose a sort order
  3. 3 Click Sort Lines and copy the result

What this does

This tool takes each line of your pasted text and reorders it according to the sort mode you choose. All processing happens in your browser — no text leaves your device.

The three options refine the input before sorting. Ignore case makes the A→Z and Z→A comparisons case-insensitive so that "Banana" and "banana" sort together. Trim spaces strips leading and trailing whitespace from each line before sorting and in the output. Remove blank lines discards any line whose content is empty or whitespace-only before the sort runs.

Before and after

Pasted text

strawberry
apple
mango
banana
cherry

After sorting A → Z

apple
banana
cherry
mango
strawberry

Common uses

Line sorting is useful any time the order of items in a list matters for readability, processing, or comparison:

After sorting, you can remove any repeated lines with the Duplicate Line Remover. If your pasted text has unwanted line breaks from a PDF or email, clean it up first with the Line Break Remover. To see exactly what changed between the original and sorted versions, paste both into the Text Diff Checker. To fix specific words, labels, or placeholders before sorting, use Find and Replace.

Common questions

Does my text get uploaded anywhere?

No. We do not upload or store your text. The sort runs as JavaScript in your browser; nothing is sent to a server and nothing is stored after you close the tab.

How does alphabetical sorting handle uppercase and lowercase?

By default, sorting is case-sensitive, but exact ordering of uppercase, lowercase, numbers, and punctuation can depend on the browser's locale-aware comparison. Turn on Ignore case to group uppercase and lowercase versions of the same word more predictably.

What happens to blank lines?

Blank lines are treated as lines with empty content. By default they are kept and sort before all other lines (an empty string sorts before any letter). Turn on Remove blank lines to discard them before sorting.

Does "Reverse order" sort anything?

No — it only flips the current order of lines. If you paste five lines and click Sort Lines with "Reverse order" selected, the last line moves to the top and the first line moves to the bottom. It does not sort alphabetically or by length.

Does "Shortest first" count characters or words?

Characters. Each line's length in characters (including spaces, if you have not enabled Trim spaces) determines its position. Lines of the same length are ordered alphabetically as a tie-breaker.