Advertisement

Sort lines by number

Sort your lines by the first number each line contains, numerically instead of alphabetically.

Sort Lines by Number

Paste lines, pick a direction, and sort numerically.

Advertisement

Numeric vs alphabetical sorting

Alphabetical sorting puts 10 before 2 because it compares characters. This tool reads the first number in each line and compares values, so 2 comes before 10, which is what you want for prices, versions, and measurements.

Lines without numbers

Lines that contain no number cannot be compared numerically, so they are moved to the end in their original order, keeping your data intact instead of dropping them.

Sort Lines by Number FAQs

Which number in the line is used?
The first number found in the line, reading left to right. In apples: 12, oranges: 3, the value 12 is used.
Does it handle decimals and negatives?
Yes. Decimals like 3.14, negatives like -5, and thousands separators like 1,000 are all parsed to their numeric value.
Where do lines without numbers go?
They move to the end of the output in their original order, so no line is ever lost.
Can I sort descending?
Yes. Choose Descending in the sort order dropdown to put the largest numbers first.
Is my text sent to a server?
No. The conversion runs entirely in your browser with JavaScript. Nothing you paste ever leaves your device.
Advertisement