ForHosting KIT · Math

Direct proportion calculator

From one known pair, get the constant and the answer you need: if 5 gives 12, the constant is 2.4 and 8 gives 19.2. Useful for unit prices, recipes, map scales and steady speeds. 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
Known x
5
Known y
12
Target x
8
You get
Constant
2.4
Target y
19.2
Relationship
y = 2.4 × x
Calculation
(12 ÷ 5) × 8 = 19.2

This direct proportion calculator turns one known pair into a reusable constant of proportionality, then applies that constant to a new input. Enter a known x value, its matching y value, and the target x value. The result shows both the constant and the predicted target y, with the relationship and calculation written out for checking. It is designed for quantities that scale together at an unchanged rate, including unit pricing, recipe amounts, distance at constant speed, production estimates, map scales, and measurement conversions with no offset.

Decide whether the relationship is directly proportional

A direct proportion has the form y = k × x, where k is a constant that does not change between matching pairs. This means that multiplying x by any factor multiplies y by exactly the same factor. If five identical items cost twelve units, doubling the number of items doubles the cost when there are no fixed charges, discounts, or changing rates.

That is a suitable direct proportion. Before calculating, ask whether a zero input would naturally produce a zero output and whether the ratio y divided by x stays constant. Both conditions are useful signals.

The calculator is not appropriate for a relationship with a starting fee, because that needs an added intercept. It is also unsuitable for inverse proportion, where increasing one quantity makes the other decrease so their product remains constant. Curved growth, tiered pricing, bulk discounts, taxes added after a threshold, and rates that change over time need different models.

Identifying the relationship first prevents a precise-looking answer from being applied to a situation that does not actually scale at one constant rate.

Find the constant from the known pair

For example, if five meters of material weigh twelve kilograms, the constant is 12 ÷ 5, or 2.4 kilograms per meter. That constant carries the meaning of the relationship, including its compound unit, so it is worth labeling it when you use the result elsewhere. The known x value cannot be zero because division by zero cannot establish a unique rate from the pair.

Negative and decimal values are accepted for algebraic uses, but your real-world subject may impose additional limits. Keep units consistent: do not pair meters in the known value with centimeters in the target unless you convert one of them first. Numeric strings are normalized, and every input must represent a finite number.

The returned relationship writes the result as y = k × x, making the rate explicit and easy to compare with a formula, worksheet, specification, or earlier observation.

Predict and check the matching target value

With the five-meter and twelve-kilogram pair, a target of eight meters produces 2.4 × 8, or 19.2 kilograms. The response includes the constant, predicted value, symbolic relationship, and substituted calculation so you can audit how the number was produced. Check direction before accepting it: for a positive direct proportion, a larger positive x should produce a larger y, while halving x should halve y.

Small display differences can occur when decimal fractions cannot be represented exactly in binary, so the calculator stabilizes numeric output to practical precision. Apply domain-specific rounding only after the proportional result is found. Currency may require two decimal places, packaging may require rounding upward to whole units, and scientific work may require significant figures based on measurement accuracy.

Scale ingredient quantities

Derive an amount per serving from a known recipe and predict the required amount for a different serving count.

Estimate constant-rate costs

Find the unit-price constant and calculate a matching cost when no fixed fees, discounts, or price tiers apply.

Convert proportional measurements

Use one trusted measurement pair to predict another value for map scales, production rates, or unit conversions without an offset.

What does the constant mean?

The constant is the amount of y per one unit of x. Its unit depends on the quantities you enter.

Does this calculator handle inverse proportion?

No. It is only for quantities that scale together with a constant ratio y divided by x.

How do I solve a direct proportion with three known numbers?

Divide the known y by the known x to get the constant, then multiply the new x by it. With 5 and 12 the constant is 2.4, so 8 gives (12 ÷ 5) × 8 = 19.2.

How can I tell if two quantities are directly proportional?

Check two signs: a zero input should naturally give a zero output, and y divided by x should stay the same for every matching pair. If both hold, the relationship y = k × x fits.

Can I use it when there is a fixed starting fee?

No. A starting fee adds an amount that does not scale, so the ratio stops being constant. Direct proportion only fits quantities that grow together at one unchanged rate, with no offset.

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/algebra/direct-proportion

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/algebra/direct-proportion \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"known_x":5,"known_y":12,"target_x":8}'
{
  "known_x": 5,
  "known_y": 12,
  "target_x": 8
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.direct_proportion",
  "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.

Find the constant from the known pair

Enter the complete observed pair as known_x and known_y. The calculator divides known_y by known_x to obtain the constant of proportionality k.

Predict and check the matching target value

After finding k, the calculator multiplies it by target_x to predict target_y. You can also divide the returned target_y by target_x and compare that ratio with the reported constant, provided target_x is not zero. Automated API calls cost $0.002 each and use the same deterministic calculation without network access, randomness, or changing external data.

What formula does the calculator use?

It calculates constant = known_y ÷ known_x, then target_y = constant × target_x.

Can known_x be zero?

No. A known_x of zero would require division by zero and cannot establish a unique proportional constant.

How much does an API calculation cost?

Each API request costs $0.002. The calculation is deterministic and requires no external service.

Read the full KIT documentation →