ForHosting KIT · Developer Utilities

Direct rule of three calculator

The direct rule of three calculator finds an unknown value when two quantities increase or decrease together at the same constant rate.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter a first quantity, its corresponding value, and a second quantity. The calculator returns the value that corresponds to the second quantity, along with the scale multiplier and the arithmetic used. It is useful for prices, recipes, distances, production estimates, and any situation where doubling one amount should double the other.

Recognize a direct proportion before calculating

A direct rule of three applies when two quantities change in the same proportion. If one quantity is multiplied by a factor, its corresponding value must be multiplied by that same factor. For example, if four notebooks cost ten currency units, seven notebooks cost more because the number of notebooks increased. This relationship is direct: buying twice as many at a constant unit price costs twice as much. The method is not appropriate when one quantity rises while the other falls, such as the time needed for a fixed job when more equally productive workers participate. It also does not model bulk discounts, fixed fees, stepped rates, or other relationships where the rate changes. Before entering numbers, identify one complete known pair: the first quantity and the value belonging to it. Then identify the second quantity whose matching value you want. Keeping corresponding measurements in the same positions is essential. If the pairs are reversed or mixed, the arithmetic may be valid but the answer will describe the wrong relationship.

Enter the three known values in corresponding positions

Use first_quantity for the known amount in the complete pair and first_value for the value associated with that amount. Use second_quantity for the new amount whose value is unknown. Suppose four kilograms of material cost ten units and you need the cost of seven kilograms. Enter 4, 10, and 7 in that order. The calculator first finds how the quantity changed by dividing seven by four. That multiplier is then applied to ten. Equivalently, it cross-multiplies seven by ten and divides the product by four. Both views express the same direct proportion: first quantity is to first value as second quantity is to the result. Decimal and negative finite numbers are accepted for algebraic work, although real-world quantities may impose their own restrictions. The first quantity cannot be zero because it forms the divisor and cannot define a usable rate. Use consistent units within each side of the relationship; convert grams to kilograms or minutes to hours beforehand when necessary, so the resulting number has a clear meaning.

Read and verify the fourth proportional

The result is the fourth proportional, the missing number that makes both ratios equal. The output also includes the multiplier, a proportion equation, and the exact calculation layout. These details make the answer easy to audit instead of presenting an unexplained number. A quick reasonableness check is valuable: when the second quantity is larger than a positive first quantity and the known value is positive, the result should also be larger. If the second quantity is half the first, the result should be half the first value. You can verify the calculation by dividing the first value by the first quantity and comparing that unit rate with the result divided by the second quantity; subject to ordinary floating-point rounding, the rates should agree. The calculator uses deterministic arithmetic and returns stable numeric precision, so identical inputs produce identical output without network access or random behavior. For automated workflows, each request costs $0.002. Treat the result as a mathematical proportional estimate, and apply domain-specific rounding only afterward, such as rounding money to the required currency precision or materials to purchasable package sizes.

Scale a recipe

Find the ingredient amount needed for a different number of servings when every ingredient scales at a constant rate.

Estimate a constant-rate price

Calculate the price of a new quantity when the unit price is unchanged and there are no fixed fees or discounts.

Project distance or output

Estimate distance, production, or consumption for a new interval when the rate remains constant.

What formula does the calculator use?

It computes result = second_quantity × first_value ÷ first_quantity, which preserves the equality of the two ratios.

How much does an API request cost?

Each API request costs $0.002. The browser calculation uses the same deterministic core logic.

Can the first quantity be zero?

No. The first quantity is the divisor, and zero cannot define the rate required by a direct proportion.

Does this solve inverse proportions?

No. Use this calculator only when both quantities change by the same multiplier. An inverse proportion uses a different relationship.

Can I enter decimal values?

Yes. All three inputs may be finite decimal numbers, and numeric strings are also accepted by the calculation core.

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/rule-of-three-direct

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/rule-of-three-direct \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"first_quantity":4,"first_value":10,"second_quantity":7}'
{
  "first_quantity": 4,
  "first_value": 10,
  "second_quantity": 7
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.rule_of_three_direct",
  "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.

Read the full KIT documentation →