Hours Worked Calculator with Lunch

#hours-worked-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e1e1; border-radius: 12px; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.05); color: #333; } .hw-header { text-align: center; margin-bottom: 25px; } .hw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; } .hw-field { display: flex; flex-direction: column; } .hw-field label { font-weight: 600; margin-bottom: 8px; font-size: 14px; color: #444; } .hw-field input { padding: 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; } .hw-full-width { grid-column: span 2; } .hw-btn { background-color: #2563eb; color: white; border: none; padding: 15px; border-radius: 6px; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; transition: background 0.2s; } .hw-btn:hover { background-color: #1d4ed8; } #hw-result-box { margin-top: 25px; padding: 20px; background-color: #f8fafc; border-radius: 8px; border-left: 5px solid #2563eb; display: none; } .hw-result-line { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 16px; } .hw-result-line strong { color: #2563eb; } .hw-article { margin-top: 40px; line-height: 1.6; color: #4b5563; } .hw-article h2 { color: #1f2937; margin-top: 25px; } .hw-article p { margin-bottom: 15px; } @media (max-width: 600px) { .hw-grid { grid-template-columns: 1fr; } .hw-full-width { grid-column: span 1; } }

Hours Worked Calculator with Lunch

Calculate your daily work duration by accounting for unpaid breaks.

Total Time Worked: 0h 0m
Decimal Hours: 0.00 hours
Estimated Gross Pay: $0.00

How to Calculate Your Work Hours

Tracking your time accurately is essential for ensuring you are paid fairly and managing your work-life balance. When calculating your shift duration, you must subtract any unpaid breaks, typically a lunch hour or a 30-minute rest period.

The Math Behind the Calculation

To calculate your hours manually, follow these steps:

  • Step 1: Convert your start and end times to a 24-hour format.
  • Step 2: Subtract the start time from the end time. If your shift spans past midnight, add 24 hours to the end time before subtracting.
  • Step 3: Convert the total duration into minutes.
  • Step 4: Subtract the total minutes of your lunch break.
  • Step 5: Convert the remaining minutes back into hours and minutes, or divide by 60 for the decimal format.

Example Calculation

If you start work at 8:30 AM and finish at 5:15 PM with a 45-minute lunch break:

  1. 8:30 AM to 5:15 PM is 8 hours and 45 minutes of total time at the workplace.
  2. 8 hours and 45 minutes equals 525 total minutes.
  3. Subtract 45 minutes for lunch: 525 – 45 = 480 minutes.
  4. 480 minutes / 60 = 8.00 net hours worked.

Importance of Decimal Hours

Most payroll systems use decimal hours (e.g., 7.5 hours instead of 7 hours and 30 minutes). This makes it easier to multiply your time by your hourly wage. To get the decimal, simply divide your minutes by 60. For example, 15 minutes is 0.25 hours, 30 minutes is 0.5 hours, and 45 minutes is 0.75 hours.

Frequently Asked Questions

What if my shift goes overnight?
Our calculator handles overnight shifts. If the end time is "earlier" in the day than the start time (e.g., Start 10 PM, End 6 AM), the tool automatically adds 24 hours to ensure the math reflects a continuous shift.

Is lunch usually paid?
In many jurisdictions, short breaks (5-20 minutes) are paid, but longer meal breaks (30+ minutes) are unpaid. Always check your local labor laws or employment contract.

function calculateWorkHours() { var startVal = document.getElementById("startTime").value; var endVal = document.getElementById("endTime").value; var lunchMinutes = parseFloat(document.getElementById("lunchBreak").value) || 0; var rate = parseFloat(document.getElementById("hourlyRate").value) || 0; if (!startVal || !endVal) { alert("Please enter both Start and End times."); return; } // Parse times var startParts = startVal.split(":"); var endParts = endVal.split(":"); var startTotalMinutes = (parseInt(startParts[0]) * 60) + parseInt(startParts[1]); var endTotalMinutes = (parseInt(endParts[0]) * 60) + parseInt(endParts[1]); // Handle overnight shifts if (endTotalMinutes <= startTotalMinutes) { endTotalMinutes += (24 * 60); } // Calculate gross duration var grossMinutes = endTotalMinutes – startTotalMinutes; // Subtract lunch var netMinutes = grossMinutes – lunchMinutes; if (netMinutes 0) { var totalPay = decimalHours * rate; document.getElementById("resEarnings").innerText = "$" + totalPay.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); earningRow.style.display = "flex"; } else { earningRow.style.display = "none"; } document.getElementById("hw-result-box").style.display = "block"; }

Leave a Comment