ForHosting KIT · Math

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
Use it from WebAPIEmailTelegramApp soon
If you enter
Operation
Simplify
First numerator
2
Denominator of fraction A
4
You get
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.

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.

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.

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/dev/fraction-calculator

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/dev/fraction-calculator \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"simplify","a_num":2}'
{
  "op": "simplify",
  "a_num": 2
}
{
  "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.

Per request$0.002

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

max_abs_int1000000000000000
max_decimal_places12
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.

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.

Automated checks

Call the API in CI and assert pretty together with numerator and denominator fields on golden fixtures.

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.

Read the full KIT documentation →