Bytelify

Sort Numbers

Sort a list of numbers ascending or descending, live as you type.

Runs in your browser, nothing sent
sort-number
Sorted

Sorts numerically (not alphabetically โ€” 2 comes before 10), live as you type, entirely in your browser.

Need the opposite? Rounding Calculator

What is Sort Numbers?

Paste a list of numbers (one per line or comma-separated) and get them sorted numerically instantly, ascending or descending, correctly ordering 2 before 10 (unlike a plain alphabetical sort, which would put 10 before 2). This distinction trips up a surprising amount of software. A spreadsheet column or JS array sorted with the default string comparator will put "10" before "2". Sorting here is numeric by design, and happens entirely in your browser as you type.

How to Use Sort Numbers

  1. 1

    Paste the List: Enter numbers one per line or comma-separated.

  2. 2

    Choose Ascending or Descending: Pick the sort direction.

  3. 3

    Copy the Result: Use the copy button to copy the correctly sorted list.

Why Numeric Sort Isn't the Default Everywhere

This tool parses each line or comma-separated entry into an actual number, then compares pairs with a-b (ascending) or b-a (descending): a true numeric comparison. That's different from a default string/alphabetical sort, which compares numbers character by character: "10" comes before "2" alphabetically because "1" sorts before "2", even though 10 is numerically larger. This exact gotcha is why a plain `.sort()` on a JavaScript array of numbers, or a spreadsheet column set to "sort as text," often produces visibly wrong-looking order. The fix is always to compare the parsed numeric values, which is what this tool does by default.

How to Sort Numbers Correctly

Worked example, the default list 42, 7, 108, 3, 56: Ascending (numeric): 3, 7, 42, 56, 108 Descending (numeric): 108, 56, 42, 7, 3 Compare that to a naive alphabetical sort of the same values, which would incorrectly order them as 108, 3, 42, 56, 7, because "1" sorts before "3", "4", "5", and "7" as the first character, regardless of the full number's value.

FAQs

Frequently Asked Questions

Common questions about Sort Numbers.

Anything that isn't a valid number is skipped, so the sorted result only includes the numeric values found.

Yes, decimals and negative values sort correctly by their actual numeric value, not just their digits.

Yes, Bytelify's Sort Numbers tool is free with no account or sign-up required.

No. Sorting runs entirely client-side in your browser, so nothing you paste is sent anywhere.