Menu
Advertisement

Hours Calculator for Work Hours and Time Cards

Type when each shift started and ended and how long the break was. You get the hours worked per day and the total, in hours and minutes and in decimal hours.

By Nethanel Bar, Co-founder & CEO

Last updated

Advertisement

Ready to actually learn to code?

Coddy teaches you by writing real code in your browser - interactive lessons, instant feedback, and AI help when you get stuck.

How to work out the hours you worked

A time card asks one question per day: how long were you working? Take the end time, subtract the start time, then take off the unpaid break. 08:45 to 17:15 is 8 hours 30 minutes on the clock, and with a 45-minute lunch that leaves 7 hours 45 minutes worked. The calculator does this for every row and adds the rows together.

Payroll and most timesheet forms want hours as one decimal number, not hours and minutes. A minute is a sixtieth of an hour, so 45 minutes is 45 divided by 60, which is 0.75, and 7:45 becomes 7.75. Every shift and the total show both forms, and the total is also given in minutes. Type an hourly rate and you get the pay for those hours as well.

A shift whose end time is earlier than its start, such as 22:00 to 06:00, is read as ending the next day, so night shifts need no extra steps. You can add up to 31 rows, one for every day of a month. Nothing is saved, so write down the total before you close the page.

What you will learn while adding up hours

  • A minute is a sixtieth of an hour. To turn minutes into decimal hours, divide by 60: 15 minutes is 0.25, 20 minutes is 0.33 and 50 minutes is 0.83.
  • Clock times wrap at midnight. When a shift ends earlier on the clock than it started, add 24 hours to the end before you subtract, which is how the calculator reads a night shift.
  • Round once, at the end. Adding the exact minutes and then rounding gives a truer total than rounding each day to two decimals and adding those.
  • In Python, subtracting two datetime values gives a timedelta. Its total_seconds() divided by 3600 is the decimal hours, the same number a payroll form asks for.

How to use the hours calculator

  1. Enter the first shift

    Fill in Start and End. The time fields are your browser's own, so they show AM and PM or a 24-hour clock depending on your settings. The first row starts as 09:00 to 17:00 with a 30-minute break; change it to your times.

  2. Take off the break

    Type the unpaid break in whole minutes, or 0 if there was none. The row shows the hours worked as h:mm and as decimal hours. If a time is missing or the break is longer than the shift, the row asks you to check it and is left out of the total.

  3. Add the other days

    Press Add another day. The new row copies the start, end and break of the row above, so a week of the same shift takes four presses. Change any day that was different, or remove a row with its cross.

  4. Read the total and the pay

    The total shows the hours as h:mm, in decimal hours and in minutes. Type your pay per hour to see the pay for those hours, rounded to two decimals and shown without a currency symbol.

Minutes to decimal hours chart

Divide the minutes by 60 and round to two places, as the calculator does. The last column shows how to read a line on a time card.

MinutesDecimal hoursOn a time card
10.028:01 is 8.02 hours
50.088:05 is 8.08 hours
60.108:06 is 8.10 hours
100.178:10 is 8.17 hours
120.208:12 is 8.20 hours
150.258:15 is 8.25 hours
200.338:20 is 8.33 hours
250.428:25 is 8.42 hours
300.508:30 is 8.50 hours
350.588:35 is 8.58 hours
400.678:40 is 8.67 hours
450.758:45 is 8.75 hours
500.838:50 is 8.83 hours
550.928:55 is 8.92 hours

Hours calculator examples

A day with a lunch break

Paste a small example into the tool and change one part at a time.

The clock shows 8 hours 30 minutes between the two times. Take off 45 minutes and the row reads 7:45 and 7.75 hours, the figure a payroll form wants.

A night shift

Copy the original value, run the tool, then compare the result.

The end is earlier than the start, so the row reads it as the next morning and adds (ends the next day). 8 hours 30 minutes less the break is 8:00, or 8 hours.

A week of shifts with pay

Rows

Monday to Thursday: 09:00 to 17:30, break 30 Friday: 09:00 to 13:15, break 0 Pay per hour: 18

Enter Monday, press Add another day four times, then change the last row to Friday's times. Four days of 8:00 and a Friday of 4:15 make 36:15, which is 36.25 decimal hours or 2,175 minutes, and the pay line shows 652.50.

The same sum in Python

datetime and timedelta
from datetime import datetime, timedelta
shifts = [("08:45", "17:15", 45), ("22:00", "06:30", 30)]total = timedelta()for start, end, brk in shifts:    a = datetime.strptime(start, "%H:%M")    b = datetime.strptime(end, "%H:%M")    if b < a:        b += timedelta(days=1)  # ends the next day    total += b - a - timedelta(minutes=brk)
print(total)                                   # 15:45:00print(round(total.total_seconds() / 3600, 2))  # 15.75

The same rule as the calculator: an end earlier than the start moves to the next day, and the break comes off. Dividing the total seconds by 3600 gives decimal hours, 15.75 for these two shifts.

Common time card mistakes

  • Reading decimal hours as hours and minutes. 7.30 hours is 7 hours 18 minutes, while 7:30 is 7.5 hours.
  • Typing the break in hours. The Break field takes whole minutes, so type 30 for half an hour, not 0.5.
  • Keeping a break you did not take. The first row starts with 30 minutes and each new row copies the break above it, so set it to 0 on days without one.
  • Entering a 24-hour shift as 08:00 to 08:00. The same start and end count as 0 hours, so split it into two rows: 08:00 to 20:00 and 20:00 to 08:00.
  • Forgetting the night the clocks change. A night shift then really lasts an hour more or less, but this calculator reads clock times only, so adjust that row by hand or use the time duration calculator, which counts the real hours.

Hours calculator FAQ

How do I calculate hours worked?

Subtract the start time from the end time, then take off any unpaid break. 08:45 to 17:15 with a 45-minute break is 7 hours 45 minutes. The calculator does this for each row and adds the rows up.

How do I convert minutes to decimal hours?

Divide the minutes by 60. 15 minutes is 0.25, 30 minutes is 0.5 and 45 minutes is 0.75, so 7:45 is 7.75 hours. The chart on this page lists the common values.

Is 7.30 hours the same as 7:30?

No. 7:30 is 7 hours and 30 minutes, which is 7.5 decimal hours. 7.30 decimal hours is 7 hours and 18 minutes.

Does it work for night shifts?

Yes. When the end time is earlier than the start time, the shift is read as ending the next day and the row says so. 22:00 to 06:00 with no break is 8 hours.

How is the pay worked out?

The exact total, in hours, is multiplied by your pay per hour and rounded to two decimals. There is no currency symbol and no overtime rule, so every hour is paid at the one rate you type.

Why does the total differ from the rows added up?

Each row's decimal hours are rounded to two places, but the total is worked out from the exact minutes. Three rows of 7:20 show 7.33 each, while their total of 22:00 is exactly 22.

What does "Check the times and the break" mean?

A time is missing in that row, or the break is longer than the shift. The row is left out of the total until you fix it.

How many shifts can I add?

Up to 31 rows, enough for every day of a month. Each new row copies the times and break of the row above it.

Are my hours sent or saved anywhere?

No. The calculator runs in your browser and sends nothing, and it saves nothing either, so the rows are gone when you reload or close the page.

Other developer tools

Coddy programming languages illustration

Learn to code with Coddy

Get started