function calculateHourlyRate() {
// 1. Get input values
var earnedInput = document.getElementById('totalEarned');
var minutesInput = document.getElementById('minutesWorked');
var resultBox = document.getElementById('result-box');
var earned = parseFloat(earnedInput.value);
var minutes = parseFloat(minutesInput.value);
// 2. Validate Inputs
if (isNaN(earned) || earned < 0) {
alert("Please enter a valid amount earned.");
return;
}
if (isNaN(minutes) || minutes <= 0) {
alert("Please enter a valid amount of minutes (greater than 0).");
return;
}
// 3. Perform Calculations
// Convert minutes to decimal hours
var decimalHours = minutes / 60;
// Calculate hourly rate (Total Earned / Hours)
var hourlyRate = earned / decimalHours;
// Calculate rate per minute (for context)
var perMinuteRate = earned / minutes;
// 4. Update UI
resultBox.style.display = 'block';
// Formatting currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('rateResult').innerText = formatter.format(hourlyRate) + "/hr";
document.getElementById('decimalResult').innerText = decimalHours.toFixed(4) + " hrs";
document.getElementById('minuteRateResult').innerText = formatter.format(perMinuteRate) + "/min";
}
How to Calculate Hourly Rate from Minutes
Whether you are a freelancer working on fixed-price projects or an employee tracking time for specific tasks, knowing how to convert minutes worked into an effective hourly rate is a crucial financial skill. This Minutes to Hourly Rate Calculator helps you determine exactly how much your time is worth based on the total compensation and the duration of the task.
The Core Formula: Hourly Rate = Total Pay ÷ (Minutes Worked ÷ 60)
Why Conversion is Necessary
Most payroll systems and freelance contracts operate on an hourly basis, yet actual work is often tracked in minutes. Since time is sexagesimal (base-60) and currency is decimal (base-10), you cannot simply divide money by minutes directly to get a standard hourly figure without first converting the time into a decimal format.
Step-by-Step Calculation Guide
If you want to perform this calculation manually, follow these three simple steps:
Determine Total Pay: Identify the total flat fee or amount earned for the task.
Convert Minutes to Hours: Divide your total minutes by 60 to get decimal hours.
Example: 45 minutes ÷ 60 = 0.75 hours.
Divide Pay by Hours: Take your total pay and divide it by the decimal hours calculated in step 2.
Example: $50 ÷ 0.75 hours = $66.67 per hour.
Real-World Examples
Short Task: You charge $30 for a task that takes 15 minutes.
Calculation: $30 ÷ (15/60) = $30 ÷ 0.25 = $120.00/hr.
Long Project: You earn $500 for a job that takes 320 minutes.
Calculation: $500 ÷ (320/60) = $500 ÷ 5.333 = $93.75/hr.
Understanding Decimal Hours
One of the most common mistakes in payroll calculation is misinterpreting minutes as decimals (e.g., thinking 1 hour and 30 minutes is 1.3 hours). It is actually 1.5 hours. This calculator automatically handles the conversion of integer minutes into precise decimal hours to ensure your billing accuracy.