Ratio Calculator
Simplify ratios, scale them, and solve proportions (A:B = C:D).
About the Ratio Calculator
The ratio calculator simplifies a ratio of two numbers to its lowest terms and converts it to a decimal. It can also test whether two ratios are equivalent — the same operation that lies at the heart of proportion problems in elementary mathematics. Ratios are foundational in fields ranging from cooking to chemistry to architecture, because they describe relationships rather than absolute quantities.
A ratio is simply a fraction expressed in colon notation. The ratio 12:18 means the same thing as the fraction 12/18, which simplifies to 2/3. Per Euclid's Elements Book V Definition 3, a ratio is "a sort of relation in respect of size between two magnitudes of the same kind." The Greek treatment was geometric rather than numeric, but the arithmetic we use today is equivalent.
Simplifying a ratio is the same operation as simplifying a fraction: divide both terms by their greatest common divisor. The GCD is computed using the Euclidean algorithm (see our GCD calculator). For ratios involving decimal numbers (such as 1.5:2.25), the calculator scales the inputs by a power of ten before applying the algorithm, then scales back so the result reads naturally.
The tool also reports the ratio as a decimal, which is useful when comparing ratios of different magnitudes. A ratio of 2:3 is 0.6667 as a decimal, while 3:5 is 0.6; the decimal form makes the comparison immediate.
How It Works
The simplification algorithm has three steps:
1. Find the GCD of the two terms using the Euclidean algorithm.
2. Divide both terms by the GCD.
3. If the second term ends up negative, move the sign to the first term.
For decimal inputs, the calculator first multiplies both terms by a power of ten (typically 10^6) to convert them to integers, then runs the Euclidean algorithm on the integers, then scales back. This avoids the rounding errors that can occur when computing the GCD of non-integers directly.
To test whether two ratios a:b and c:d are equivalent, the calculator cross-multiplies: a * d === b * c. This is the same test used to compare two fractions for equality, and it is the foundation of proportion problems. If the cross-products are equal, the two ratios describe the same relationship.
The tool rejects the input pair (0, 0) because the ratio 0:0 is undefined — the GCD is undefined and the relationship between two zeros is not well-defined. A ratio with one zero term (such as 0:5) is valid and simplifies to 0:1.
Worked Examples
Using the default values 12 and 18, the GCD is 6, so the simplified ratio is 2:3. The decimal value is 12 / 18 = 0.6667. This is the simplest form, since 2 and 3 share no common factors.
For decimal inputs 1.5 and 2.25, the calculator multiplies both by 100 to get 150 and 225, computes the GCD as 75, and simplifies to 2:3. The decimal value is 1.5 / 2.25 = 0.6667, the same as the previous example — the two ratios are equivalent.
To test proportionality, enter 12 and 18 in the first pair and 4 and 6 in the second. The cross-products are 12 * 6 = 72 and 18 * 4 = 72, so the ratios are equivalent. Entering 12 and 18 versus 5 and 7 gives cross-products 84 and 90, so the ratios are not equivalent. This is the technique used to scale recipes: if 2 cups of flour need 3 eggs, then 6 cups of flour need 9 eggs, since 2:3 = 6:9.
When to Use This Tool
Use the ratio calculator when you need to:
- Scale a recipe up or down by simplifying the ratio of two ingredients.
- Compare prices per unit (such as $3.50 for 500 g versus $5.20 for 750 g).
- Verify that two fractions are equivalent in elementary mathematics homework.
- Compute aspect ratios for screens, images, or page layouts (16:9, 4:3, 21:9).
- Mix ingredients in chemistry or pharmacology where exact ratios matter.
- Determine the gear ratio needed to achieve a target rotational speed.
- Simplify the ratio of two quantities in financial analysis (debt-to-equity, price-to-earnings).
Limitations & Disclaimer
This calculator works on two or four terms at a time. The decimal-scaling step multiplies inputs by 10^6, so very small inputs (below 10^-6) may lose precision. The cross-multiplication test for equivalence uses floating-point equality, which may produce false negatives for ratios involving irrational numbers. For exact symbolic comparisons, use a rational arithmetic library. See our disclaimer for full details.
Frequently Asked Questions
What is the difference between a ratio and a fraction?
Arithmetically, nothing: a ratio a:b is the same as the fraction a/b. The convention differs: ratios are written with a colon and used to compare quantities of the same kind (such as 3 cups of flour to 2 cups of sugar), while fractions are written with a slash and used to denote a part of a whole (such as 3/5 of the pizza). The simplification algorithm is identical.
How does the calculator handle decimal inputs?
It multiplies both terms by a power of ten (typically 10^6) to convert them to integers, runs the Euclidean algorithm on the integers, then divides the result back by the same power. This avoids floating-point rounding in the GCD computation. For 1.5 and 2.25, the intermediate integers are 1,500,000 and 2,250,000, and the GCD is 750,000, giving the simplified ratio 2:3.
Can ratios be greater than 1?
Yes. The ratio 5:2 is greater than 1, because the first term is larger than the second. There is no rule that ratios must be in lowest terms or less than 1. The simplified form preserves the original relationship.
How do I test whether two ratios are equivalent?
Cross-multiply: a:b equals c:d if and only if a*d equals b*c. The calculator does this automatically when you fill in all four fields. For example, 12:18 equals 4:6 because 12*6 = 72 = 18*4. If the cross-products differ, the ratios are not equivalent.
What happens if one of the terms is zero?
The ratio 0:5 is valid and simplifies to 0:1, since the GCD of 0 and 5 is 5. The decimal value is 0. The ratio 5:0 is also valid in pure arithmetic (its decimal value is Infinity), but in practical applications it usually signals an error such as dividing by zero. The ratio 0:0 is undefined and reported as an error.
Why does the calculator move a negative sign to the first term?
By convention, ratios are written with the sign on the first term rather than the second, so that -3:4 reads naturally as a negative ratio. The simplification step preserves the magnitude of each term and adjusts the sign accordingly, so 3:-4 becomes -3:4 and -3:-4 becomes 3:4.
Last updated: September 9, 2026 · Author: HT99 Tools Editorial Team