The work time calculator formula, explained with examples

Every time clock, payroll program and calculator on this site runs on one small formula. Learn it and you can work out any shift, any week, and any overtime total on the back of an envelope, and you will know exactly what the software is doing when it produces a number you were not expecting. Here is the formula, the minutes trick that makes it foolproof, and worked examples from a single day up to a full overtime week.

By Johnson Ramzan · Updated October 26, 2026

Open the Work Time Calculator

Home / Guides / The Work Time Formula

Here is the whole thing in one line:

Paid work time = (end time - start time) - unpaid breaks

That is it. There is no hidden second formula for weekends, no special version for night shifts, and no separate method for overtime weeks. Everything else in this guide is about applying that one line without tripping over the clock, because clock arithmetic is where people go wrong: hours have 60 minutes instead of 100, AM turns into PM halfway through, and night shifts end on a different day from the one they started. The minutes method below removes all three problems at once.

Step one: turn clock times into minutes

The reliable way to use the formula is to convert every clock time into minutes since midnight before you subtract anything. The conversion is: hours times 60, plus the minutes, using the 24-hour clock. So 9:20 AM becomes 9 x 60 + 20 = 560 minutes. And 5:45 PM becomes 17 x 60 + 45 = 1,065 minutes. Once both times are plain numbers, the formula is ordinary subtraction, and there is no borrowing across the hour and no AM/PM confusion, because the 24-hour conversion already handled it.

  1. Convert the start time to minutes since midnight.
  2. Convert the end time to minutes since midnight. If the shift crosses midnight, add 1,440 to the end time.
  3. Subtract start from end. That is the gross shift length in minutes.
  4. Subtract the unpaid break minutes. That is the paid work time.
  5. Turn the answer back into hours and minutes, or divide by 60 for decimal hours.

This is exactly the sequence our work time calculator runs for every day of a week, and it is the sequence worth copying when you check a shift by hand.

Worked example 1: an ordinary day with awkward minutes

You clock in at 9:20 AM and out at 5:45 PM, with a 30-minute unpaid lunch. Convert: the start is 560 minutes, the end is 1,065 minutes. Subtract: 1,065 minus 560 is 505 minutes gross. Take off the lunch: 505 minus 30 is 475 minutes paid. Turn it back: 475 divided by 60 is 7 hours with 55 minutes left over, so 7 hours 55 minutes. In decimal form, 475 divided by 60 is 7.92 hours. Try doing that subtraction directly in hours and minutes and you will feel why the minutes method exists: 5:45 minus 9:20 forces you to borrow an hour and turn it into 60 minutes mid-sum, which is where most errors sneak in.

Worked example 2: an overnight shift

Night shifts break the naive version of the formula, because the end time is smaller than the start time. You start at 10:30 PM and finish at 6:15 AM, with a 30-minute meal break. Convert: the start is 22 x 60 + 30 = 1,350 minutes. The end, 6:15 AM, is 375 minutes, which is less than the start, so add 1,440: 375 plus 1,440 is 1,815. Now subtract: 1,815 minus 1,350 is 465 minutes gross. Minus the 30-minute break gives 435 minutes paid, which is 7 hours 15 minutes, or 7.25 decimal hours. The add-1,440 step is the only extra rule the formula ever needs.

A construction worker in a hard hat at a building site - The work time calculator formula, explained with examples
The minutes method turns every shift, even an overnight one, into a single clean subtraction.

The weekly formula and the overtime split

A week is just the daily formula repeated seven times and added up. The new element is overtime, and it is important to see where it enters: not inside any day's calculation, but on the weekly total. Under US federal rules, hours past 40 in a workweek are overtime, paid at one and a half times the regular rate.

Say your five days come out at 8.92, 8.50, 9.25, 8.75 and 9.08 decimal hours. The week totals 44.50 hours. Split it: 40 hours are regular, and 4.50 hours are overtime. At $20 an hour, regular pay is 40 x $20 = $800, and overtime pay is 4.50 x $30 = $135, giving gross pay of $935. Notice that no single day in that week looks dramatic; the overtime appears purely because the total crossed 40. This is why checking only individual days can miss money: the formula that matters for overtime lives at the week level.

The formula with rounding applied

Many employers round punches to the nearest 5, 6, 10 or 15 minutes. When rounding applies, it happens before the formula, not after: each punch is rounded first, then the rounded times go into the subtraction. So a 9:07 clock-in under nearest-15 rounding becomes 9:00, and a 5:38 clock-out becomes 5:45, and the formula runs on those. Rounding the final total instead is a different method that can produce a different answer, which is why two systems can disagree about the same shift by a few minutes while both are "using the formula". If your totals never quite match payroll's, ask which side of the formula the rounding sits on.

Formula errors that produce wrong totals

Four mistakes show up constantly. The first is subtracting in 12-hour form, treating 5:45 PM as 5.75 and 9:20 AM as 9.33 and hoping the difference works out; it does not, because the PM hours are understated by 12. The second is forgetting the add-1,440 step on overnight shifts and getting a negative answer that then gets "fixed" by guessing. The third is subtracting a break the time clock already subtracted, the double deduction. The fourth is mixing forms mid-calculation, converting one time to minutes and leaving the other in hours and minutes. The minutes method prevents all four, as long as you run every time through the same conversion before touching the formula.

Run the formula without the envelope

Once the formula makes sense, let the tool do the repetitive part. The free work time calculator applies it to a full week of shifts with your rounding rule, then shows the weekly total, the overtime split and the gross pay. It is the quickest way to confirm that a week you worked out by hand matches what the formula gives. And for quick one-off sums of lengths of time, the time calculator on the homepage adds and subtracts durations directly.

Frequently asked questions

What is the formula for calculating work time?

Paid work time equals the end time minus the start time, minus any unpaid breaks. In minutes: convert both clock times to minutes since midnight, subtract the start from the end, then subtract the unpaid break minutes. Divide the result by 60 if you need decimal hours for payroll.

How do I subtract clock times without getting confused?

Never subtract the hours and minutes separately. Convert each time to minutes since midnight first: hours times 60, plus the minutes. Then one clean subtraction gives you the length of the shift in minutes, and you can turn it back into hours and minutes at the end.

Does the formula work for overnight shifts?

Yes, with one adjustment. If the end time is earlier than the start time because the shift crosses midnight, add 1,440 minutes (24 hours) to the end time before subtracting. A shift from 10:30 PM to 6:15 AM becomes 1,815 minus 1,350, which is 465 minutes before breaks.

Where does overtime fit into the formula?

Overtime is calculated on the weekly total, not inside the daily formula. Add up the paid time for all seven days of the workweek first. Anything over 40 hours is overtime under US federal rules, paid at one and a half times the regular rate, while the first 40 hours stay at the regular rate.

Can I use this formula in a spreadsheet like Excel?

Yes. Put the start time in one cell and the end time in another, subtract start from end, subtract the break as a fraction of a day or in minutes, and format the result as a duration or multiply by 24 to get decimal hours. The logic is identical to the minutes method in this guide.

About the author
Johnson Ramzan builds and maintains every calculator on Time Calculator Tools himself, and he tests each one against worked examples he has done by hand before it is allowed near a reader. His guides follow US Department of Labor guidance on hours worked, overtime and rounding, and he writes them the way he would want a payslip explained to him: plain English, real numbers, and no step skipped. When a reader writes in with a shift pattern the tools handle badly, fixing it goes to the top of his list.
Last updated: October 26, 2026

Related guides

How to Calculate Work Time in Decimal Hours

The minutes-to-decimal conversion, the chart worth memorizing, and the 7.45 trap that shortchanges people.

Read the guide

How to Calculate Work Time in Excel

The same formula built in spreadsheet cells, with the formatting settings that stop Excel mangling your totals.

Read the guide

How to Calculate Work Time for Hourly Employees

The complete routine for hourly staff, from raw punches to a checked weekly gross pay figure.

Read the guide

How to Calculate Work Time With a Lunch Break

The break side of the formula: how an unpaid lunch comes off a shift, with a full worked week.

Read the guide