⚖️ Ratio Calculator

🔧 Operation

📝 Simplify a ratio

Up to 8 parts. Reduces by the GCD.

📝 Solve A / B = C / D — leave one blank

Leave exactly one field blank to solve for it.

📝 Scale a ratio to an anchored value

The anchored part becomes exactly the target value; all other parts scale by the same factor.

📝 Split a total proportionally

Returns exact float allocations and a largest-remainder rounded array that sums to the total.

📝 Percentage of the whole

Each part as a percentage of the sum (precision ≥4 decimal places).

📤 Result

{{ line.label }} {{ line.value }}
Enter values and the result will appear here.
⚠️

ℹ️ About Ratio Calculator

What is a ratio?

A ratio is an ordered comparison of two or more quantities expressed in the form A:B (or A:B:C for more parts). Two ratios are equal when they reduce to the same lowest terms; the equation linking two equal ratios is called a proportion.

The defining identity of a proportion is the cross-multiplication rule: A / B = C / D is equivalent to A × D = B × C. Given any three of the four positive terms, the fourth is determined uniquely.

This calculator covers the common ratio search tasks in one place: simplify a ratio, solve a missing proportion term, scale a recipe or drawing, split a total by weighted parts, and convert part-to-whole ratios into percentages.

Use cases

  • Recipe scaling: a 2:3:5 flour-sugar-butter ratio scaled so the flour weighs 200g becomes 200:300:500.
  • Mixing concentrates: 1:9 cordial-to-water at 100 ml of cordial requires 900 ml of water.
  • Gear ratios & pulleys: reduce 36:24 to 3:2 to read the mechanical advantage at a glance.
  • Scale drawings & maps: 1:50000 means 1 cm on paper equals 50000 cm (500 m) on the ground.
  • Equity splits: three founders on a 4:3:3 split sharing $1,000,000 receive $400k, $300k, $300k.
  • Aspect ratios: a 16:9 frame 1920 px wide is exactly 1080 px tall.
  • Mortar & concrete mixes: 1:2:4 cement-sand-gravel scaled to a 50 kg bag of cement requires 100 kg sand, 200 kg gravel.

Formulas used by each mode

  • Simplify: divide every integer part by gcd(A, B, C...) to get lowest terms.
  • Solve proportion: for A / B = C / D, use A × D = B × C; for example, if D is missing, D = (B × C) / A.
  • Scale: compute factor = target / anchorPart, then multiply every part by that factor.
  • Split total: each exact allocation is total × part / sum(parts).
  • Percentage: each percentage is part / sum(parts) × 100, shown with at least 4 decimal places where needed.

Worked examples

  • Simplify: 12:18:30 → GCD 6 → 2:3:5.
  • Solve proportion: 3 / 4 = 9 / ? → 3 × ? = 4 × 9 → ? = 36 / 3 = 12.
  • Scale: 2:3:5 with the first part set to 20 → factor 10 → 20:30:50.
  • Split: $100 across 1:1:1 → exact 33.333…, 33.333…, 33.333… → rounded 34, 33, 33 (sum 100).
  • Percentage: 1:1:2 → 25%, 25%, 50% (total 4 → 100%).

Largest-remainder rounding (the "Hamilton method")

When a total cannot be split exactly into integer shares, the calculator first allocates the floored integer for each part, then distributes the remaining units one-by-one to the parts with the largest fractional remainders. This guarantees the rounded array sums to the requested total — the same algorithm used in apportionment, vote-allocation, and finance to avoid rounding drift.

For example, splitting 10 by 1:1:1 yields exact allocations of 3.333… each. Floors give [3, 3, 3] totalling 9. The single leftover unit goes to the first tied position, producing [4, 3, 3] — sum 10.

References and standards

  • OpenStax Contemporary Mathematics defines ratios, proportions, and the cross-products property used by the proportion solver.
  • OpenStax Prealgebra gives applied proportion examples, including rate and unit-price style problems.
  • NIST SP 811 is a useful reference for measurement notation and unit consistency before comparing or scaling quantities.
  • U.S. Census apportionment methods describe Hamilton/Vinton largest-remainder allocation, the same rounding approach used when integer split results must add back to the exact total.

Limits and edge cases

  • All values must be positive numbers. Zero parts are rejected (division by zero).
  • Simplify requires positive integers. Fractional ratios should be normalized first, such as 1.5:1 → 3:2.
  • Keep units consistent before comparing values. For example, convert meters and centimeters to the same unit before simplifying a measurement ratio.
  • Rounded split results are deterministic. If two parts have identical fractional remainders, the earlier part receives the leftover unit first.
  • Large decimals may display rounding at the selected precision; use exact integer parts when financial or engineering auditability matters.
  • Up to 8 parts are supported per ratio.
  • Calculations run entirely in your browser. The API endpoint runs the same TypeScript logic on the server via Node.

API Usage Example:

POST /api/tools/math/ratio-calculator
Content-Type: application/json

{
    "operation": "simplify",
    "parts": [
        12,
        18,
        30
    ]
}
Ready