Calculate hours worked between two times with break deduction and pay
Knowing exactly how many hours you have worked is essential for accurate pay, timesheet submissions, and compliance with the UK Working Time Regulations. This calculator takes a start time and end time in 24-hour format, deducts your break time, and gives you the total hours worked in both standard and decimal format. It also handles overnight shifts automatically, so if you work from 22:00 to 06:00, it correctly calculates 8 hours rather than returning a negative result. For workers paid by the hour, the calculator includes an optional hourly rate field that calculates your gross pay for the shift. This is useful for checking that your payslip matches your hours, calculating expected earnings before a shift, or comparing the value of different shift patterns. The calculation uses Decimal.js for monetary precision, ensuring that the pay figure is accurate to the penny. Under the UK Working Time Regulations 1998, adult workers (aged 18 and over) are entitled to a minimum 20-minute uninterrupted rest break when the working day exceeds 6 hours. Young workers (under 18) are entitled to a 30-minute break after 4.5 hours. These are minimum legal entitlements; many employers offer longer breaks. Always deduct your actual break time for accurate results.
To calculate your hours worked: 1. Enter the start time in 24-hour format. For example, 9:00 AM is 9 hours 0 minutes. 2:30 PM is 14 hours 30 minutes. 2. Enter the end time in 24-hour format. For example, 5:00 PM is 17 hours 0 minutes. 3. Enter total break time in minutes. For a standard lunch break, enter 30 or 60. If you took no break, enter 0. 4. Optionally enter your hourly rate to calculate gross pay. Leave this at 0 if you just want hours worked. 5. View the results. The calculator shows hours and remaining minutes (e.g. 7 hours 30 minutes), decimal hours (e.g. 7.50), break time deducted, and gross pay if an hourly rate was entered. 6. For overnight shifts, just enter times normally. If you start at 22:00 and end at 06:00, the calculator correctly returns 8 hours (assuming no break deduction).
The calculation works as follows: Total minutes = (end hour x 60 + end minute) - (start hour x 60 + start minute) If the result is negative (end time before start time), the calculator adds 24 x 60 = 1,440 minutes to handle overnight shifts. Break deduction: total minutes = total minutes - break minutes Decimal hours: total minutes / 60 (rounded to 2 decimal places) Gross pay: decimal hours x hourly rate (calculated with Decimal.js for precision) For example, 9:00 to 17:00 with 30 minutes break: total minutes = (17 x 60 + 0) - (9 x 60 + 0) = 1020 - 540 = 480. After break: 480 - 30 = 450 minutes. Decimal hours = 450 / 60 = 7.50. At 15/hour: gross pay = 7.50 x 15 = 112.50. For overnight: 22:00 to 06:00: total minutes = (6 x 60) - (22 x 60) = 360 - 1320 = -960. Add 1440: -960 + 1440 = 480 minutes = 8 hours.
This calculator shows gross pay before tax and National Insurance. Your take-home pay will be lower depending on your tax code and NI category. For a full breakdown of net pay, use the Salary Calculator on this site. The UK National Living Wage as of April 2025 is 12.21 per hour for workers aged 21 and over. If your effective hourly rate (gross pay divided by hours worked including unpaid overtime) is below the minimum wage, contact ACAS or HMRC.