ForHosting KIT · Math

Order from least to greatest

Enter 5, 1, 4, 2, 3 and get 1, 2, 3, 4, 5: smallest first, largest last. Duplicates stay, and numbers are compared by value, not as text, so 10 never lands before 2. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Values
5, 1, 4, 2, 3
You get
Quantity
5
Original
5, 1, 4, 2, 3
Sorted
1, 2, 3, 4, 5
Min
1

Ordering a list of numbers from least to greatest is the first move in almost every statistics lesson and a daily chore in spreadsheets, gradebooks, and sensor logs. Students type that exact phrase when they need homework help; analysts type it when a column of measurements is still in capture order. This calculator accepts a non-empty list of finite numbers, copies it, and returns the unique non-decreasing sequence so the smallest value sits first and the largest sits last. Ties keep both copies.

What least-to-greatest order means on a number line

Least to greatest is the everyday name for a non-decreasing numeric order: every later value is greater than or equal to every earlier value. On the number line the smallest observation sits at the far left and the largest at the far right, so the first output is the sample minimum and the last output is the sample maximum. Negative numbers come before zero, zero comes before positives, and a larger magnitude on the negative side is smaller, not larger: negative twenty is less than negative two.

Duplicate values stay in the list because two equal scores occupy two ranks; the sort is stable, so equal numbers keep the relative order they had in the input. Decimals and scientific-notation tokens are compared by their numeric value, not by string length or digit count, which is why 9.5 comes after 9 and before 10, and why 1e2 is treated as one hundred. A one-element list is already ordered and is returned unchanged.

The comparison never uses locale collation, Unicode code points, or a lexicographic string sort, because those would put 10 before 2. There is no descending option on this landing; greatest-to-least is a different search intent.

Where an ordered numeric list earns its keep

Science labs and operations teams receive probe readings, wait times, or batch weights in capture order and need the same numbers lined up before they look at spread, outliers, or a five-number summary. Product and support teams rank ticket ages, cart values, or latency samples so the smallest (or largest) case is obvious at a glance.

Keep requests within the published length limit, pin the ordered array in tests, and you get a reproducible least-to-greatest list for homework, LMS plugins, and edge workers without standing up a spreadsheet or a statistics library of your own. If you later need the median, the mean and mode together, quartiles, or a descending greatest-to-least ranking, treat those as separate search intents and landings rather than overloading this order-from-least-to-greatest page.

Homework and exam answer keys

Order mixed classroom lists of integers and decimals from least to greatest so teachers and auto-graders share one ground truth, including ties and negatives.

Lab readings still in capture order

Line up probe measurements, wait times, or batch weights before you inspect the minimum, the maximum, or any later summary statistic.

Quick numeric ranking in a pipeline

Sort a short numeric sample of latencies, cart values, or ages in a script without pulling a spreadsheet or a statistics library.

What happens if a value is not a finite number?

NaN, Infinity, empty strings, and non-numeric text are rejected and are not billed.

Does the sort keep duplicate numbers?

Yes. Equal values occupy equal ranks and both copies stay in the output. The merge sort is stable, so ties keep the relative order they had in the input.

Will this put 10 before 2 the way a text sort would?

No. Comparison is numeric, not lexicographic. Two comes before ten. Locale collation and string sorts are different products.

How are negative numbers ordered?

They come before zero, and among them the one with the larger size is the smaller number: minus twenty is less than minus two. Positive numbers follow zero from smallest to largest.

Are decimals and scientific notation sorted correctly?

Yes, because numbers are compared by value, not by how many digits they have: 9.5 lands after 9 and before 10, and 1e2 is treated as one hundred.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/order-from-least-to-greatest

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/order-from-least-to-greatest \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":[5,1,4,2,3]}'
{
  "values": [
    5,
    1,
    4,
    2,
    3
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.order_from_least_to_greatest",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_items100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Any token that is not a finite number — missing slots, empty strings, NaN, Infinity, or text — is rejected with invalid_input instead of being silently dropped.

What least-to-greatest order means on a number line

An empty list has no order statistics, so this engine rejects it with invalid_input rather than inventing a phantom sequence. The algorithm is a deterministic stable merge sort on a copy: the original sequence is never mutated, and the same payload always produces the same JSON.

Input contract, response shape, and error behaviour

Numeric strings inside the array are coerced after a strict numeric pattern check, and a comma, space, or semicolon separated string is also accepted for simple text forms so a pasted homework row works without wrapping brackets. Classic textbook checks include five, one, four, two, three whose ordered list is one, two, three, four, five, and the mixed list three point five, negative two, zero, negative two, ten, negative one half, which becomes negative two, negative two, negative one half, zero, three point five, ten. A single-element list such as forty-two returns itself as both min and max. Send a JSON body with one required field named values: a non-empty array of finite numbers. Aliases numbers, data, and list are accepted and behave the same. On success the response includes count as n, original as the cleaned input in the order you sent it, sorted as the non-decreasing copy that is the primary result, min as the first entry of that copy, max as the last entry, order as the constant least_to_greatest, and a short formula string that restates the comparison. Failed validation — missing values, an empty list, non-finite entries such as NaN or Infinity, non-numeric tokens, or a list longer than one hundred thousand numbers — returns invalid_input and is never charged.

Where an ordered numeric list earns its keep

Elementary and middle-school worksheets constantly ask students to order mixed integers and decimals from least to greatest; a single trusted oracle that returns cleaned JSON speeds grading, demo setup, and answer-key generation without a human re-sorting every row. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

How do I order a list of numbers from least to greatest?

Send a non-empty array of finite numbers in the values field (aliases numbers, data, list). The API returns sorted as the non-decreasing copy, plus min, max, and count.

What does the order-from-least-to-greatest calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →