Skip to content
Case Converter Online
en

Number Sorter

Paste a list of numbers and put them in numerical order, smallest to largest or largest to smallest. You also get the sum, average and median.

Order
Count
0
Smallest
0
Largest
0
Sum
0
Average
0
Median
0

How to sort numbers

  1. Paste your numbers into Your numbers. Any mix of commas, spaces, tabs and new lines works as a separator.
  2. Pick the order: Smallest first or Largest first.
  3. Switch on Remove duplicates if each value should appear only once.
  4. Choose how the result is separated, then press Copy.

The tool ignores words and symbols around the numbers, so you can paste a messy line such as “Scores: 42 (Tom), 19 (Ana), 100 (Li)” and get back 19, 42, 100.

Ascending and descending order

Ascending means going up: each number is larger than the one before it. Descending means going down.

Original Ascending Descending
42, 7, 19, -8, 3.5 -8, 3.5, 7, 19, 42 42, 19, 7, 3.5, -8

Negative numbers are smaller than zero, so they come first in ascending order. The further a negative number is from zero, the smaller it is: -20 comes before -3.

The statistics below the result

Sorting is often the first step in understanding a set of numbers, so the tool also shows:

  • Count: how many numbers were found
  • Smallest and Largest: the minimum and maximum
  • Sum: all the numbers added together
  • Average: the sum divided by the count, also called the mean
  • Median: the middle value of the sorted list

The median is the number in the middle once the list is in order. With an even count, it is the average of the two middle numbers. It is a better guide than the average when a few values are much larger or smaller than the rest, as with house prices or salaries.

Why sorting as text goes wrong

If you have tried to sort numbers in a text editor or with a basic sort function, you may have seen this:

1, 10, 100, 2, 25, 3

That is alphabetical order. The program is comparing the numbers as words, character by character, so everything that starts with “1” comes before anything that starts with “2”. This sorter compares the numeric values, which gives 1, 2, 3, 10, 25, 100.

Common uses

  • Homework: ordering integers, decimals and negative numbers
  • Finding the median of test scores or survey answers
  • Cleaning data before pasting it into a spreadsheet
  • Removing duplicate IDs, order numbers or lottery picks
  • Ranking prices, times or measurements

Sorting in a spreadsheet

For data already in Excel or Google Sheets, select the column and use Data, then Sort. To sort with a formula, use =SORT(A1:A20) for ascending order and =SORT(A1:A20, 1, FALSE) for descending order in Google Sheets. For a quick list from an email or chat message, pasting it here is faster.

Number Sorter: questions and answers

How do I put numbers in numerical order?

Paste or type your numbers into the left box. They can be separated by commas, spaces or new lines. The sorted list appears on the right. Choose 'Smallest first' for ascending order or 'Largest first' for descending order.

What is ascending and descending order?

Ascending order goes from the smallest number to the largest, like climbing stairs: 1, 2, 3. Descending order goes from the largest to the smallest: 3, 2, 1.

Does it handle negative numbers and decimals?

Yes. Negative numbers are placed below zero and decimals are sorted by their true value, so -8 comes before 3.5, which comes before 7. Numbers written in scientific notation, such as 1e3, are also understood.

How should I enter numbers with thousands separators?

Type them without the separator: 1000, not 1,000. The sorter treats a comma as the gap between two numbers, so 1,000 would be read as 1 and 0.

Is there a limit on how many numbers I can sort?

There is no set limit. Lists with many thousands of numbers sort almost instantly because the work is done in your browser.

More text tools

See all tools