Enter your quantities below to find the unit rate and see step-by-step calculations.
Step-by-Step Work:
What is a Unit Rate?
A unit rate is a ratio that compares two measurements where the second measurement is simplified to exactly one unit. It tells you how much of the first quantity corresponds to a single unit of the second quantity. Unit rates are fundamental in mathematics, physics, and everyday life for comparing prices, speeds, and efficiency.
Common examples include:
Speed: Miles per hour (Distance / Time)
Unit Price: Cost per item (Total Cost / Number of Items)
Wages: Dollars per hour (Total Pay / Hours Worked)
Fuel Economy: Miles per gallon (Distance / Fuel Used)
How to Calculate Unit Rate
To find the unit rate, you simply perform division. The formula is:
Unit Rate = Quantity 1 ÷ Quantity 2
For example, if you drive 150 miles in 3 hours, the calculation is 150 ÷ 3 = 50. The unit rate is 50 miles per hour.
Why is Showing Work Important?
Understanding the process is just as important as the answer. This calculator provides the "work" to help students and professionals verify their math. It breaks down the ratio into a fraction and demonstrates the division required to simplify the denominator to 1.
Using the Unit Rate Calculator
Enter Quantity 1: This is the numerator (the top number of the fraction). Examples: Total price, total distance, total words typed.
Enter Quantity 2: This is the denominator (the bottom number). This represents the group you want to reduce to a single unit. Examples: Number of boxes, hours, minutes.
Enter Unit Names (Optional): Adding names like "dollars" or "kg" helps format the final sentence for clarity.
Calculate: Click the button to see the rate per single unit and the calculation steps.
function calculateUnitRate() {
// 1. Get input elements
var numInput = document.getElementById('ur-numerator');
var denInput = document.getElementById('ur-denominator');
var numUnitInput = document.getElementById('ur-num-unit');
var denUnitInput = document.getElementById('ur-denom-unit');
var errorMsg = document.getElementById('ur-error-msg');
var resultsArea = document.getElementById('ur-results');
var finalDisplay = document.getElementById('ur-final-display');
var workContent = document.getElementById('ur-work-content');
// 2. Parse values
var numerator = parseFloat(numInput.value);
var denominator = parseFloat(denInput.value);
var numUnit = numUnitInput.value.trim() || "units";
var denUnit = denUnitInput.value.trim() || "units";
// 3. Validation
errorMsg.style.display = 'none';
resultsArea.style.display = 'none';
if (isNaN(numerator) || isNaN(denominator)) {
errorMsg.innerText = "Please enter valid numbers for both quantities.";
errorMsg.style.display = 'block';
return;
}
if (denominator === 0) {
errorMsg.innerText = "The denominator cannot be zero. Division by zero is undefined.";
errorMsg.style.display = 'block';
return;
}
// 4. Calculation
var rate = numerator / denominator;
// Format rate to avoid crazy decimals, but keep precision if needed
var formattedRate = (rate % 1 === 0) ? rate : rate.toFixed(2);
// If it's a really small number, give more decimals
if (rate 0) {
formattedRate = rate.toFixed(6);
}
// 5. Display Result
finalDisplay.innerHTML = formattedRate + " " + numUnit + " / " + denUnit + "";
// 6. Generate "The Work"
var workHtml = "";
// Step 1: Set up the ratio
workHtml += "Step 1: Write as a ratio (fraction)";
workHtml += "
";
// Step 2: Explain division
workHtml += "Step 2: Divide the numerator by the denominator";
workHtml += "To find the rate for 1 " + denUnit + ", we divide the top number (" + numerator + ") by the bottom number (" + denominator + ").";
workHtml += "