Sort Lines Numerically

Sort whole numeric values from smallest to largest. Negative numbers, decimal fractions and scientific notation are supported.

Sort values without alphabetical surprises

Alphabetical order can place 10 before 2. Numeric mode compares the value of the entire line, allowing signs, decimal points and scientific notation. The output keeps each original representation: 4e2 remains 4e2.

Example: input and output

10
-3
2.5
4e2
not a number
-3
2.5
10
4e2
not a number

Use Load sample in the tool to try this example.

Rules and limits

Currency symbols, thousands separators, decimal commas and embedded labels are not parsed as numbers. Nonnumeric and non-finite values stay at the end in input order. JavaScript number precision applies; use alphabetical sorting for long identifiers that must remain distinct.

Questions and answers

Where do nonnumeric lines go?

They stay at the end in their original order. Blank lines are removed by default; disable Remove empty lines to keep them.

Can I sort item2 and item10?

Use Natural sort for labels with embedded digits. Numeric mode requires the whole line to be a number.

Is my text uploaded?

No. Processing happens locally in your browser. No account is required. Settings links share options, not your text.