ForHosting KIT · Math

Adding fractions

1/2 + 1/3 is exactly 5/6, with 0.833333 shown alongside only as a display decimal. Enter two fractions and get their sum reduced to lowest terms, plus the mixed-number form whenever the sum is not a whole number. 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
First numerator
1
A den
2
B num
1
B den
3
You get
Numerator
5
Denominator
6
Sign
1
Pretty
5/6

Alongside the simplified fraction you get its sign, its mixed-number form when it is not an integer, and a decimal rendering, so the answer drops straight into homework checks, recipe scaling, measurement math or any pipeline that speaks in ratios instead of floats. A zero denominator is rejected with a clear error before any arithmetic happens.

Why add fractions exactly instead of using decimals

Decimal arithmetic is convenient until precision matters. One third is not 0.333333; it is exactly 1/3, and the moment you round it you have introduced an error that compounds with every further operation. Working directly when adding fractions keeps every value exact from start to finish: the common denominator is computed with integer arithmetic, the numerators are combined, and only at the very end — if you ask for it — is a decimal approximation produced.

That ordering matters in education, where a student comparing 1/2 + 1/3 against 5/6 needs the exact answer, and it matters in engineering and cooking alike, where quantities arrive as ratios of integers and converting them to floats just to add them throws away information you had for free. You send four integers; you receive the exact sum, reduced, with the sign normalized onto the numerator so downstream code never has to guess where the minus sign lives.

How the sum is simplified

Every result passes through the same reduction pipeline. First the addition is applied over a common denominator: for A = a/b and B = c/d, the sum is (a·d + c·b) / (b·d). Then the greatest common divisor of the resulting numerator and denominator is computed with the Euclidean algorithm and both are divided by it, which guarantees the fraction is in lowest terms — 2/4 comes back as 1/2, never as 2/4.

If the denominator carries the sign, it is moved to the numerator, so −1/2 is always reported as numerator −1, denominator 2. When the simplified denominator is 1 the result is an integer and the response says so explicitly, omitting the mixed-number fields; otherwise you also receive the whole part and the remaining proper fraction, which is the form recipes and carpentry measurements are usually quoted in. The decimal field is a fixed six-place rendering meant for display, never for feeding back into exact calculations.

Check homework step by step

Verify that 3/4 + 2/5 really is 23/20 and see the mixed form 1 3/20 for the final written answer.

Scale recipes without rounding

Combine fractional cup measures exactly — 2/3 cup plus 1/4 cup is 11/12 cup, not a rounded decimal guess.

Validate ratio pipelines

Keep engineering or financial ratios exact through every addition, converting to decimal only at display time.

Is the sum always simplified?

Yes. The numerator and denominator are divided by their greatest common divisor, so the fraction is always returned in lowest terms.

Can I use negative fractions?

Yes. Negative numerators and denominators are accepted; the sign is always normalized onto the numerator in the result.

How is the decimal value computed?

It is a six-decimal-place rendering of the exact fraction, intended for display only — the fraction itself is the exact answer.

What is 2/3 cup plus 1/4 cup?

It is exactly 11/12 cup, not a rounded decimal guess. Kitchen quantities often come as fractions, and the calculator adds them as fractions, so no precision is lost along the way.

When is the sum shown as a mixed number?

Whenever the reduced sum is not a whole number. For 3/4 + 2/5 you get 23/20 and also 1 3/20, the form recipes and carpentry measurements usually use. A whole-number sum is reported as such, with no mixed form.

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/math/adding-fractions

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/math/adding-fractions \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a_num":1,"a_den":2,"b_num":1,"b_den":3}'
{
  "a_num": 1,
  "a_den": 2,
  "b_num": 1,
  "b_den": 3
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.adding_fractions",
  "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.

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.

The adding fractions API takes the numerators and denominators of two fractions, adds them with exact integer arithmetic, and returns the sum already reduced to its lowest terms.

Why add fractions exactly instead of using decimals

This endpoint treats the fraction as the native unit of work.

How the sum is simplified

All of this is pure integer math: no floating point enters the reduction at any step, so the answer is deterministic and identical on every call.

Validation, errors and fair billing

Negative numerators and denominators are fully supported, so adding a negative fraction simply yields a correct signed result. The endpoint fails fast and fails cheap. Before any arithmetic, every field is checked: each numerator and denominator must be an integer — sent either as a JSON number or as a plain integer string like "−3" or "7" — and neither denominator may be zero. A zero denominator is the classic division-by-zero trap, and instead of returning an infinity or a quiet NaN that would poison a downstream pipeline, the API rejects the request with an invalid_input error that names the offending field. Because the error is classified as the client's mistake, the request is not charged: you only ever pay for answers, at $0.002 per call. The same code that runs on the API runs free in your browser on this page, so you can verify any calculation by hand before wiring it into an automated workflow, and the browser version enforces identical validation, meaning there are no surprises when you move from testing to production.

What does it cost?

$0.002 per request via the API. It is also free to run in your browser on this page.

What happens if a denominator is zero?

The request is rejected with an invalid_input error naming the field, and it is not charged.

Do I get a mixed number back?

Whenever the simplified sum is not an integer, the response includes mixed_whole, mixed_num and mixed_den with the mixed-number form.

Read the full KIT documentation →