Audited 31 Jul 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Least to Greatest Calculator

Sort a comma-separated list of numbers from least to greatest, with negatives, decimals and repeated values handled exactly, plus a value count.

Least to Greatest Calculator

Ascending values
-2, 3.5, 3.5, 9, 10
Your numbers in ascending order, least first, separated by commas, with repeats kept and trailing zeros dropped.
Value count
5
Model scope
Numeric ascending order using exact Decimal comparisons; repeated values are retained, and the page does not parse dates, words, units, fractions written with slashes, or locale-specific decimal commas.

Background.

Putting numbers in order is easy until the list mixes negatives, decimals of different lengths and repeated values. Then the familiar slips appear. Is 0.45 bigger than 0.5 because it has more digits? No: 0.5 is 0.50, and 50 hundredths beat 45. Is −10 bigger than −2 because 10 is bigger than 2? No: on a number line −10 lies further left, so it is the smaller. Should a value that appears twice be listed twice? Yes, if you are going to take a median or a range from the list, because dropping a repeat changes both.

Ascending order is also the first step in a good deal of statistics. The median is the middle of the sorted list, the minimum and maximum sit at its two ends, and quartiles and percentiles are read off particular positions. Sorting a long list by hand is where mistakes creep in, so the page does that step exactly: every value is compared as a decimal number, with no floating-point rounding, and every repeat is kept.

Type or paste the values separated by commas. Negative numbers, decimals and scientific notation such as 1e3 are understood. Fractions written with a slash, percentages, units, dates and words are not, and the page names the item it could not read instead of guessing at it.

One trap deserves a warning before you paste a column from a spreadsheet. Because the comma separates values, a number written with a thousands separator, 1,000, is read as two values, 1 and 0, and a European decimal comma, 3,5, becomes 3 and 5. Neither produces an error, so check the value count against what you expected, strip out thousands separators and write decimals with a point.

What is least to greatest calculator?

Arranging numbers from least to greatest means listing them in ascending order, so that each value is less than or equal to the one after it: x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎. The bracketed subscripts are order-statistic notation: x₍₁₎ is the smallest value, x₍ₙ₎ the largest and x₍ₖ₎ the k-th smallest. Equal values sit next to each other and each keeps its own place in the count, so five numbers containing one repeat still give five entries once sorted.

How to use this calculator.

  1. Type or paste your numbers separated by commas, for example 9, -2, 10, 3.5, 3.5. Spaces after the commas are fine, but a space on its own does not separate two values.
  2. Convert fractions and percentages to decimals first. For repeating decimals keep enough digits to separate close values: 1/3 entered as 0.33 sorts below 0.333, even though 1/3 is the larger number.
  3. Remove thousands separators and write decimals with a point, since every comma starts a new value.
  4. Check the value count against the number of items you meant to enter, then read the list from left, the least, to right, the greatest.

The formula.

x_(1) <= x_(2) <= ... <= x_(n)

The output satisfies x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎. Each item between commas is read as an exact decimal and compared by numeric value, not as text, so 10 comes after 9 even though an alphabetical sort would put "10" first, and −10 comes before −2. Trailing zeros carry no weight: 0.5 and 0.5000 are equal and both print as 0.5. Repeats are kept, which matters for anything computed from the sorted list. With n values, the median is the middle value when n is odd and the average of the two middle values when n is even, and the range is x₍ₙ₎ − x₍₁₎. Very large and very small values are printed in exponent form, so 0.0000001 appears as 1e-7.

A worked example.

Example

Take the list 9, -2, 10, 3.5, 3.5. The only negative number, −2, is smaller than everything else and goes first. The two copies of 3.5 are equal, so they sit side by side in second and third place. That leaves 9 and 10, compared as numbers rather than as text, so 9 comes before 10. The sorted result is -2, 3.5, 3.5, 9, 10, with a value count of 5. With five values the median is the third one, 3.5, and the range is 10 − (−2) = 12. Had the repeated 3.5 been dropped, the four remaining values would give a median of (3.5 + 9) ÷ 2 = 6.25, which is why the duplicate stays in the list.

values9, -2, 10, 3.5, 3.5

Frequently asked questions.

I entered 1,250 and 980 but got three values back. What happened?
The comma inside 1,250 was read as a separator, so the page saw 1, 250 and 980. Thousands separators and decimal commas both split numbers this way without raising an error. Remove them, write 1250 and 980, and the value count will show the 2 you intended.
How do I put fractions in order?
Convert each to a decimal and sort those, because the page does not read the slash. For 3/8, 2/5 and 1/3, that gives 0.375, 0.4 and about 0.3333, so the order is 1/3, 3/8, 2/5. Keep four or more digits for repeating decimals so close fractions do not tie.
Why does 0.405 come before 0.45 and 0.5?
Compare decimals place by place, padding with zeros if it helps: 0.405, 0.450 and 0.500. The tenths digits are 4, 4 and 5, so 0.5 is largest; between the other two the hundredths digits 0 and 5 decide it. The number of digits after the point has no bearing on size.
How do negative numbers fit into the order?
The further a negative number is from zero, the smaller it is, so −10 comes before −2, which comes before 0. A quick check is to picture a number line: least to greatest always runs from left to right, and every negative number lies to the left of zero.
Can I get the list from greatest to least instead?
The page only sorts in ascending order, but descending order is the same list reversed. Read the result from right to left: for the example, 10, 9, 3.5, 3.5, -2. Repeated values stay next to each other in either direction.
Why does my sorted list show 1e-7 instead of 0.0000001?
Very small and very large numbers are printed in exponent form to keep them readable. 1e-7 means 1 × 10⁻⁷, exactly 0.0000001, and it sorts in exactly the same place; likewise 1e+23 is a 1 followed by 23 zeros. Only the display changes, never the value.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
x_(1) <= x_(2) <= ... <= x_(n)
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon