jamuny.editor

Sort Text Lines Alphabetically

Paste a list and get it back in order. Numbers inside lines are compared as numbers, so item2 sorts before item10 instead of after it: the thing that makes a plain alphabetical sort frustrating for filenames and versions. Case is ignored by default, which is usually what you want for names; switch it on to get strict codepoint ordering where uppercase leads, matching what Notepad++ calls a lexicographic sort.

What "local-first" means

Most online text tools send whatever you paste to a server, run the work there, and send a result back. Your words sit in someone else's logs, backups and databases, and you have to trust a privacy policy.

Local-first means the opposite: the whole tool is downloaded to your browser and runs on your own device. Nothing you type is transmitted anywhere: not to us, not to anyone. There is no server that could receive it, which is a stronger guarantee than a promise not to look.

Three consequences worth knowing:

You do not have to take that on trust. Open your browser's developer tools, watch the network panel, and type: nothing appears in it.The network's verify page walks through the same check on every Jamuny tool.

How to use it

  1. Paste your lines. A list of names, filenames, versions or log entries.
  2. Choose a direction. A to Z or Z to A.
  3. Decide about case. Case-insensitive suits words and names. Case-sensitive gives strict codepoint order, which suits identifiers.

Worked example

Numbers inside lines compare as numbers

Input
item10
Banana
item2
apple
Cherry
Output
apple
Banana
Cherry
item2
item10

Why item2 comes before item10 here

Runs of digits are compared as numbers rather than character by character. A plain alphabetical sort compares the "1" of item10 against the "2" of item2, decides 1 comes first, and puts item10 ahead, which is almost never what anyone meant.

This is natural sort order, and it is why file managers list chapter2 before chapter10 while a naive script does the opposite. It matters most for filenames, version strings and anything numbered without zero-padding.

What case sensitivity actually changes

Case-insensitive sorting uses linguistic ordering, so apple, Banana and Cherry interleave the way a reader expects. That is the default because it is what you want for names and words.

Case-sensitive switches to raw codepoint order, where every uppercase letter sorts before every lowercase one, so Z comes before a. That looks wrong for prose and is exactly right for identifiers, because it matches what Notepad++ calls a lexicographic sort and what most programming languages do by default.

What sorting does not do

It only reorders. Every line you paste comes back, including duplicates and blanks. If you want repeats collapsed, run the list through the duplicate remover first. Doing it in that order lets you check the deduplicated result before committing to a new order.

It also does not know about columns. A sort operates on whole lines, so a tab-separated table sorts by whatever is in the first column, and there is no way to sort by the third. For that you want a spreadsheet, which is one of the few jobs on this site genuinely better done elsewhere.

Mixed content and where it lands

Real lists are rarely uniform. When numbers, words and symbols are mixed, the ordering follows the browser's own locale comparison: punctuation and symbols generally sort before digits, digits before letters. That is consistent, but it is not always what you would have guessed.

Blank lines collect together rather than being scattered, because an empty string compares equal to every other empty string. If your list has structural blanks separating groups, sorting will pull them all to one end and the grouping is lost, which is worth checking before you sort something that was deliberately laid out.

Leading whitespace counts. An indented line sorts by its indentation before its text, so a list where some entries were pasted with a tab in front will appear to sort at random until the whitespace is stripped.

Questions

Why does item10 come after item2 here but not elsewhere?

Because runs of digits are compared as numbers rather than character by character. A plain alphabetical sort compares "1" against "2" and puts item10 first, which is almost never what you meant.

What does the case-sensitive option actually change?

It switches from linguistic ordering to raw codepoint ordering, so every uppercase letter sorts before every lowercase one, so Z sorts before a. That matches Notepad++ lexicographic sorting and matters when the lines are identifiers rather than words.

Are duplicate or blank lines removed?

No. Sorting only reorders; every line you paste comes back, blanks included. Use the remove duplicate lines tool first if you want them collapsed.