Skip to content
Documents·1 min read·

Sort lines

Sort a list of lines alphabetically or numerically, in ascending or descending order.

The answer

Each line is one item. Alphabetical sort ignores case. Numeric sort reads the numbers inside the line so 2 comes before 10.

Fill in the inputs above to see your result

How this works

The sort compares whole lines. Alphabetical order uses a base-letter comparison, so “b” follows “a” and capitalization does not create a second group.

Numeric order still sorts lines, but it compares the digit runs as numbers. “item 2” comes before “item 10”. Descending order reverses the same comparison.

Practical steps

  1. 1

    Paste one item per line.

  2. 2

    Choose numeric order when the lines start with or contain amounts.

  3. 3

    Choose descending order when the largest value should be first.

Examples

  • 10, then 2, numeric ascending

    2 comes first, then 10.

Common mistakes

  • ×

    Using alphabetical order on a numbered list and then wondering why 10 appears before 2.

Frequently asked questions

Will this sort words inside a line?

No. The line stays intact. Only the order of lines changes.

Where do blank lines go?

They are lines, so they sort with the rest. A blank line usually comes first in ascending order.

Continue reading