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
Run — free
Worked example
- Values
- 3, 1/2, -2.5, 4, 7/4
- 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.
What you can do with it
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.
FAQ
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.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
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"]}'const res = await fetch("https://api.kit.forhosting.com/stat/ordering-numbers", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"values": [
"3",
"1/2",
"-2.5",
"4",
"7/4"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/ordering-numbers",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"values": [
"3",
"1/2",
"-2.5",
"4",
"7/4"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/ordering-numbers", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"values":["3","1/2","-2.5","4","7/4"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"values":["3","1/2","-2.5","4","7/4"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/ordering-numbers", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"values": [
"3",
"1/2",
"-2.5",
"4",
"7/4"
]
}Example response
{
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items | 500 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
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.
Technical questions
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.