Rule of three

Find the fourth value in a direct proportion from three known values.

A corresponds to B, C corresponds to X. Example: if 3 items cost $12, then 5 items cost $20. Use the same units for A and C. This calculation assumes direct proportionality.

Both dots and commas are accepted as decimal separators.

Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.

Method and assumptions

Method version 1.0.0 · Updated

Direct proportion

Formula: X = B × C ÷ A

A corresponds to B, C corresponds to X. Example: if 3 items cost $12, then 5 items cost $20. Use the same units for A and C. This calculation assumes direct proportionality.

a
A — reference quantity
b
B — value corresponding to A
c
C — new quantity

Deterministic floating-point calculation. The displayed result is rounded to a maximum of 12 significant digits.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const a = 4, b = 10, c = 6;
const x = b * c / a;
console.log(x); // 15
TypeScript
const a = 4, b = 10, c = 6;
const x: number = b * c / a;
console.log(x); // 15
Python
a, b, c = 4, 10, 6
print(b * c / a)  # 15
Java
double a = 4, b = 10, c = 6;
System.out.println(b * c / a); // 15
C#
double a = 4, b = 10, c = 6;
Console.WriteLine(b * c / a); // 15