How the duration is calculated
Each time is converted to minutes since midnight, the start is subtracted from the end, and any unpaid break is removed:
If the end time is earlier than the start (an overnight span, like 22:00 to 06:00), 24 hours are added so the result is still positive.
Worked example
From 9:00 to 17:30 with a 30-minute break:
Hours-and-minutes vs decimal hours
People read time as hours and minutes, but payroll and spreadsheets use decimal hours, where the minutes are expressed as a fraction of 60. So 8 hours 30 minutes is 8.5, and 7 hours 15 minutes is 7.25. This calculator shows both formats so you can use whichever you need.