b4rn1 · texttoolstext
Bin TX-05·Text

Sort lines

Sort any list alphabetically, in reverse, by line length or numerically, with case and duplicates handled.

BinTX-05
DepartmentText
Free runsUnlimited
Runs onYour device
Loading the tool…

The code for this tool is fetched only when you open it.

What sort lines does

Sort lines arranges a list alphabetically, numerically, by length or in reverse. It is the quick fix for unordered exports — a column of names, a set of version numbers, a list of prices that should run low to high.

How it works

An array sort with a chosen comparator. Numeric mode parses leading numbers so that 2 comes before 10, which a default string sort gets backwards.

Runs on your device

Nothing is uploaded, because nothing needs to be: the browser already has a decoder, a canvas and an encoder. Close the tab and every trace of the file is gone, which is a stronger guarantee than any deletion policy.

Formats and limits

LimitsNo limit. Sorting is in-memory on the string; a hundred thousand lines sorts in well under a second.
PriceFree, unlimited, no account

Worth knowing

  • Natural numeric mode is the difference between a useful list and 1, 10, 100, 2. It compares parsed numbers, not characters.
  • Case handling and leading/trailing whitespace can be ignored during comparison so that mixed-case lists do not end up with two alphabets.

Questions about sort lines

Why does 10 come before 2 in other sorters?

Because they compare characters, and "1" sorts before "2". Numeric mode here compares the numbers instead, which is what a human reading a list expects.

Can I sort by line length?

Yes. Length mode is useful for finding outliers in a column of tags or for ordering by how much text each entry carries.

Will numbers sort as numbers?

Yes in numeric mode: 2 comes before 10. In alphabetical mode 10 comes before 2, because that is how text sorts.

Can I remove duplicates while sorting?

There is a switch for it, applied after sorting.

Where is my file processed?

No. There is no upload step and no server-side copy: the browser decodes and re-encodes the file in this tab, and the network carries nothing about it.

Can I use this without a connection?

Once the page has loaded, yes — the processing code runs locally and no further request is needed. The first load has to come from the network like any page.

What does it cost?

Free with no account and no daily limit — counting and calculating are not metered, because they cost nothing to run.