b2KIT

Advanced Text Line Sorter

Sort text lines alphabetically, numerically, by length, or by custom column with reverse and case-sensitive options.

Tested tool guide Text and writing tools Checked August 16, 2026

What Advanced Text Line Sorter does, with a checked example

Alphabetical sorting compares strings character by character, so a list of numbers comes out 10, 100, 20 rather than 10, 20, 100. This sorter adds modes that fix that: numeric sorting compares values, length sorting compares character counts, and column sorting picks one field out of delimited lines such as CSV or tab-separated data. Reverse flips any mode, and case sensitivity is a separate toggle. The surprise most users hit: alphabetical order is decided by the first differing character, so 10 still precedes 9 unless numeric mode is on, and with case-sensitive sorting a word that starts with an uppercase letter can jump ahead of lowercase words.

Worked example

A concrete input and expected output from the current implementation.

Input

orange
banana
apple
kiwi

Expected output

apple
banana
kiwi
orange

Every line starts with a distinct letter, so alphabetical ascending is decided by the first character alone: a, b, k, o. All lines are lowercase, so the case-sensitive option does not change this result.

How the result is produced

1

How the four modes compare lines

Alphabetical mode compares lines as text, folding case only when the case-insensitive option is on. Numeric mode reads each line as a number and orders by value, so 10 follows 9 rather than preceding it. Length mode compares character counts. Reverse flips the final order, whichever mode produced it.

2

Column sorting and what stays fixed

Column mode is for records where each line holds several fields separated by a shared delimiter such as a comma or tab: the sort key becomes the chosen column rather than the whole line, which matters when the field to order by is not the first. Rows that are missing the column still appear in the output, and lines that tie on the key keep the relative order the sort gives them, so glance at both ends of the result before trusting it.

Good uses

  • Alphabetizing a glossary, playlist, or list of names before pasting it into a document or spreadsheet where A-to-Z order is expected.
  • Ordering numerical lists such as prices, page numbers, or measured values, where plain alphabetical sorting would put 10, 100, and 120 before 9.
  • Reordering a small CSV or tab-separated export by one of its columns, for example sorting product rows by price, without opening a spreadsheet program.

Limits and checks

  • Duplicates survive. This tool reorders lines; it does not deduplicate. Two identical lines stay as two lines, so a list that needs unique values must be deduped before or after sorting.
  • Whitespace is part of the line. A line starting with a space sorts before a line that starts with a letter, and trailing spaces change length-mode counts, so pasted text with indentation or ragged spacing may not order as the eye expects.
  • Numeric mode only fully controls lines that are plain numbers. Empty lines and mixed entries such as Item 7 are not numeric; where they land in the result is worth verifying before you rely on the order.

Common questions

Why does my numeric list still come out with 10 before 9?

Because you are in alphabetical mode, where lines are compared as text: the first character decides, and 1 comes before 9. Switch to numeric mode, which compares the lines as numbers, and 9 sorts ahead of 10. The same applies to column mode when the chosen field holds numbers.

Does this tool remove duplicate lines or blank lines?

No. A sorter reorders what it is given; identical lines are kept as separate entries, and blank lines stay in the output, usually grouped at one end. If you need a unique list, remove duplicates before pasting or run a dedupe tool on the result.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools