ForHosting KIT · Math

Ordering numbers

Enter 3, 1/2, -2.5, 4 and 7/4 and get -2.5, 1/2, 7/4, 3, 4: each entry is turned into its real value, so fractions and decimals line up correctly, and your original spellings are kept. 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
3, 1/2, -2.5, 4, 7/4
You get
Quantity
5
Ordered
-2.5, 1/2, 7/4, 3, 4
Values
-2.5, 0.5, 1.75, 3, 4

Ordering mixed numbers is a daily classroom and data-prep task: a worksheet lists 3, 1/2, -2.5, and 7/4, and someone has to put them on a number line from least to greatest. Lexical sorts fail here because the string 10 comes before 2, and a fraction such as 3/4 is not a decimal until it is evaluated. This ordering-numbers calculator accepts a list of integer, decimal, and fraction strings, converts each entry to a finite real value, and returns the same tokens in ascending numeric order together with the parsed values.

Why mixed numbers cannot be sorted as text

A list that mixes whole numbers, decimals, and fractions looks simple until you try to sort it with a dictionary comparison. The string 10 sorts before 2 because the character 1 is less than 2; the token 1/2 has no numeric meaning until the division is performed; and 1 1/2 is a mixed number, not two separate items. The only honest order is the order of the real values those tokens represent on the number line.

This capability walks the list once, parses each entry as an integer, a decimal (optional scientific notation), a simple fraction a/b, or a mixed number of the form whole numerator/denominator, then sorts by that finite value in ascending order. Negative signs apply to the whole quantity, so -1 1/2 is negative one and a half, not minus one plus one half. Equal values keep their original relative order, which makes the result stable when 1/2 and 0.5 both appear.

Empty tokens, letters, Infinity, NaN, and a zero denominator are not finite numbers and never produce a partial ranking.

Where an ordering-numbers tool earns its keep

Classrooms and tutoring platforms use an ordering-numbers calculator so learners can check least-to-greatest homework that mixes fractions with decimals without flipping a sign or treating 1/4 as larger than 1/3 because four is larger than three. Exam generators need a deterministic oracle that marks a wrong permutation as wrong and that refuses a blank or a word instead of silently dropping the bad cell.

Analysts who inherit a column typed as text — 3, 1/2, 2.25, 7/4 — can rank it before charting or joining without opening a spreadsheet that may interpret 1/2 as a date. Keep lists inside the five-hundred-item cap, pin the ordered tokens in tests, and you get a reproducible ranking for worksheets, LMS plugins, and edge workers without standing up a computer-algebra system for a one-line sort.

Homework: least to greatest

Give students a mixed list such as 3, 1/2, -2.5, and 7/4 and check their handwritten order against a deterministic ranking.

Clean a mixed numeric column

Rank a text column of integers, decimals, and fractions before charting or joining, without a spreadsheet recasting 1/2 as a date.

Exam and LMS auto-grading

Score ordering items with an oracle that rejects unparseable tokens instead of dropping them and inventing a shorter list.

How do I order mixed integers, decimals, and fractions?

Send a non-empty values array of number strings.

Which spellings are accepted?

Integers (3, -12), decimals (0.5, -2.5, .25), simple fractions (1/2, -7/4), and mixed numbers (1 1/2, -2 3/4). Spaces around the slash are allowed. A zero denominator is rejected.

What happens if one entry is not a number?

Empty text, letters, Infinity, NaN, and 1/0 are not finite numbers. Invalid input is not billed.

How are ties ordered when two tokens have the same value?

The sort is stable: equal values such as 1/2 and 0.5 keep the order they had in the input, so the ranking is deterministic.

How is a negative mixed number such as -1 1/2 read?

As negative one and a half: the minus sign applies to the whole quantity, not just the whole-number part. That is why -1 1/2 sorts below -1 instead of being read as minus one plus a half.

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/ordering-numbers

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/ordering-numbers \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"values":["3","1/2","-2.5","4","7/4"]}'
{
  "values": [
    "3",
    "1/2",
    "-2.5",
    "4",
    "7/4"
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.ordering_numbers",
  "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_items500
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 cannot be read as a finite number — empty text, letters, or a fraction with a zero denominator — fails with invalid_input and is not billed. The same deterministic parse path runs free in the browser and as a prepaid API call at $0.002 per successful request.

Why mixed numbers cannot be sorted as text

The response returns the original spellings in that order, plus the parsed finite numbers, so a student can still see 7/4 next to 3 while a script can consume 1.75 and 3.

Input contract, accepted spellings, and errors

Each string may be an integer such as 3 or -12, a decimal such as 0.5, -2.5, or .25, a simple fraction such as 1/2 or -7/4, or a mixed number such as 1 1/2 and -2 3/4. Spaces around the slash are allowed. On success the body includes count, ordered as the original tokens from least to greatest, and values as the corresponding finite numbers rounded to twelve significant digits for a stable contract across runtimes. Name the bad index in the message so a form can highlight the row. POST a JSON body with one required field named values: a non-empty array of strings, at most five hundred entries. Aliases numbers, list, and data are accepted and behave the same. A comma, semicolon, or newline separated string is also accepted so a pasted column can be sorted without wrapping every cell in JSON quotes; spaces are not used as separators because mixed numbers already contain a space. Failed validation — a missing values field, an empty list, more than five hundred entries, or any token that cannot be parsed as a finite number — returns invalid_input and is never charged. Pair this page with a five-number summary or a mean-median-mode tool if you need descriptive statistics after the list is ordered; this endpoint only ranks the tokens.

What does the ordering numbers tool 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 →