Fraction calculator
Enter 2/4 and get 1/2, already in lowest terms, plus its mixed form and an exact decimal. Add, subtract, multiply or divide two fractions with no rounding noise, and negatives such as −8/3 show up correctly as −2 2/3. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Operation
- Simplify
- First numerator
- 2
- Denominator of fraction A
- 4
- Numerator
- 1
- Denominator
- 2
- Sign
- 1
- Whole-number part
- 0
People search for a reliable fraction calculator that simplifies by GCD, adds and multiplies without floating-point noise, and shows mixed numbers correctly for negatives.
What lowest terms means, and how it is reached
A fraction is in lowest terms when its top and bottom numbers share no common factor except 1. To get there, the calculator finds the greatest common divisor of the two numbers with Euclid's method and divides both by it, so 2/4 becomes 1/2. Every result goes through that same step, whether it comes from simplifying, adding, subtracting, multiplying or dividing. Whole numbers count as fractions over 1, zero always appears as 0/1, and the minus sign always sits on the top number, never on the bottom one.
Mixed numbers, decimals and the usual traps
A mixed number splits a fraction into a whole part and a remainder. With negatives the whole part is cut toward zero, which is why −8/3 reads as −2 2/3. The decimal is cut, not rounded, to the number of places you choose, from 0 to 12, so it never claims more precision than it has. Typical uses are checking homework, tripling a half-cup in a recipe without decimal drift, or combining gear ratios exactly. Dividing by zero, or entering a zero bottom number, is refused instead of guessed.
Simplify with greatest common divisor
Every successful result is reduced to lowest terms using the Euclidean algorithm on absolute values. The denominator is always forced positive so the sign lives only on the numerator. Zero is normalized to 0/1 rather than 0/5 or −0/1.
Intermediate products are checked against a hard absolute bound below 10^15 so a malicious or huge input cannot hang the free browser tool or overflow silent wrapping.
Four operations and mixed forms
You can simplify a single fraction, add or subtract two fractions, multiply, divide, request an explicit mixed breakdown, or convert a mixed number into improper form. Mixed whole parts use truncation toward zero, which is why −8/3 becomes −2 2/3 with remainder 2 over 3. Integer inputs such as 7 are treated as 7/1 and remain exact after reduction.
What you can do with it
Homework and study
Check fraction homework with exact reduced answers, mixed forms and a stable decimal string you can compare in solutions.
Recipes and ratios
Scale recipe ratios by multiplying fractions without decimal drift when tripling a half-cup measure.
Engineering ratios
Combine gear or resistor ratios as exact rationals before exporting a truncated decimal for documentation.
FAQ
How is the fraction simplified?
By Euclidean GCD on absolute values, then the denominator is forced positive so the sign stays on the numerator.
Is −8/3 shown as a mixed number?
Yes: −2 2/3, using truncation toward zero for the whole part and an absolute remainder.
Does the decimal round?
No. It truncates toward zero. 2/3 with 2 places is 0.66, not 0.67.
Can I type 1/2 as a string?
Not in v1. Send integer numerators and denominators, or use the form fields that compose them.
How do I turn a mixed number into an improper fraction?
Choose the option that converts a mixed number, enter the whole part and the fraction, and you get a single improper fraction in lowest terms. A whole number such as 7 is simply treated as 7/1.
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/dev/fraction-calculator \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"op":"simplify","a_num":2}'const res = await fetch("https://api.kit.forhosting.com/dev/fraction-calculator", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"op": "simplify",
"a_num": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/fraction-calculator",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"op": "simplify",
"a_num": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/fraction-calculator", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"op":"simplify","a_num":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"op":"simplify","a_num":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/fraction-calculator", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"op": "simplify",
"a_num": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.fraction_calculator",
"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_abs_int | 1000000000000000 |
max_decimal_places | 12 |
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
This tool does exactly that with integer arithmetic only, so the free browser version and the API always agree byte for byte on numerator, denominator, pretty text and truncated decimals.
Simplify with greatest common divisor
Integer-only math is the whole point of a free on-device tier-A tool that must never surprise the user between browser and API.
Four operations and mixed forms
Integer-only math is the whole point of a free on-device tier-A tool that must never surprise the user between browser and API.
Decimals truncated, not rounded
The decimal field is a string produced by pure integer long division truncated toward zero to the requested number of places. Places may be 0 through 12 inclusive; out of range values are invalid_input. Integer-only math is the whole point of a free on-device tier-A tool that must never surprise the user between browser and API.
Hard errors instead of silent fixes
The tool never invents a clamped denominator or rewrites a float into a nearby rational. A zero denominator, division by zero, non-integer fields, conflicting signs on to_improper, and absolute overflow all return typed invalid_input errors. Integer-only math is the whole point of a free on-device tier-A tool that must never surprise the user between browser and API.
Integration use cases
Automated checks
Call the API in CI and assert pretty together with numerator and denominator fields on golden fixtures.
Technical questions
What if the denominator is zero?
The tool returns invalid_input and does not invent a result or clamp the value.
Is it free in the browser?
Yes on desktop and mobile. The native app uses the API at $0.002 from prepaid KIT balance.