How Do You Calculate Hours Worked

Hours Worked Calculator

Work Summary

Total Time (HH:MM):
Decimal Hours:
function calculateHoursWorked() { var startTime = document.getElementById('startTime').value; var endTime = document.getElementById('endTime').value; var breakMin = parseFloat(document.getElementById('breakMinutes').value) || 0; if (!startTime || !endTime) { alert('Please enter both start and end times.'); return; } var startParts = startTime.split(':'); var endParts = endTime.split(':'); var startInMinutes = (parseInt(startParts[0]) * 60) + parseInt(startParts[1]); var endInMinutes = (parseInt(endParts[0]) * 60) + parseInt(endParts[1]); // Handle overnight shifts if (endInMinutes < startInMinutes) { endInMinutes += 1440; // Add 24 hours in minutes } var totalMinutes = endInMinutes – startInMinutes; var netMinutes = totalMinutes – breakMin; if (netMinutes < 0) { alert('Break time cannot be longer than worked time.'); return; } var finalHours = Math.floor(netMinutes / 60); var finalMins = netMinutes % 60; var decimalHours = (netMinutes / 60).toFixed(2); document.getElementById('hhmmsummary').innerText = finalHours + ' hours ' + finalMins + ' minutes'; document.getElementById('decimalsummary').innerText = decimalHours + ' hrs'; document.getElementById('resultsArea').style.display = 'block'; }

How to Calculate Hours Worked

Calculating your hours worked accurately is essential for payroll, billing, and productivity tracking. Whether you are an employee tracking your timesheet or a freelancer billing a client, the process follows a simple mathematical formula.

The Step-by-Step Manual Method

To calculate hours worked manually, follow these four steps:

  1. Determine Start and End Times: Convert your times to a 24-hour clock (military time) to avoid confusion between AM and PM. For example, 1:00 PM becomes 13:00.
  2. Convert to Minutes: Multiply the hours by 60 and add the remaining minutes. (Example: 8 hours 30 minutes = 510 minutes).
  3. Subtract the Difference: Subtract the start minutes from the end minutes. If you worked overnight, add 1,440 minutes (one full day) to the end time before subtracting.
  4. Subtract Breaks: Remove any unpaid break time (e.g., a 30-minute lunch) from the total.

Converting Minutes to Decimal Hours

Most payroll systems require time in a decimal format rather than minutes. To find this, divide your total minutes by 60.

Minutes Decimal Equivalent
15 Minutes 0.25 hours
30 Minutes 0.50 hours
45 Minutes 0.75 hours

Example Calculation

Imagine you start work at 8:45 AM and finish at 5:15 PM with a 45-minute unpaid lunch break.

  • Start Time: 08:45 (525 total minutes)
  • End Time: 17:15 (1,035 total minutes)
  • Gross Time: 1,035 – 525 = 510 minutes (8 hours, 30 minutes)
  • Net Time: 510 – 45 = 465 minutes
  • Decimal Hours: 465 / 60 = 7.75 hours

Pro Tip: Always double-check your company's policy on rounding. Some employers round to the nearest 15 minutes, while others use the exact minute for calculation.

Leave a Comment