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
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.
- 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.
- 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.
- Remove thousands separators and write decimals with a point, since every comma starts a new value.
- 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.
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.
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.
Frequently asked questions.
I entered 1,250 and 980 but got three values back. What happened?
How do I put fractions in order?
Why does 0.405 come before 0.45 and 0.5?
How do negative numbers fit into the order?
Can I get the list from greatest to least instead?
Why does my sorted list show 1e-7 instead of 0.0000001?
References& sources.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- 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