Time Duration Calculator
Calculate time duration between two times or add and subtract hours and minutes from a time. Handles overnight shifts and decimal hours.
Start and end time
How to use Time Duration Calculator
-
Choose a mode
Select 'Calculate duration' to find how long it is between two times, or 'Add / subtract time' to compute a resulting clock time from a start time plus a duration.
-
Enter the start time
Type or pick the start time in 24-hour HH:MM format. For 1 PM enter 13:00; for midnight enter 00:00. The tool uses 24-hour format to eliminate AM/PM ambiguity.
-
Enter the end time or duration
In duration mode, enter the end time. In add/subtract mode, enter the hours and minutes you want to add or subtract and pick the operation. Negative values are not supported — use subtract mode instead.
-
Enable 'Crosses midnight' for overnight ranges
In duration mode, toggle 'Crosses midnight' whenever the end time is numerically earlier than the start time (e.g. 22:00–06:00, 23:30–07:30, 19:00–04:00). This adds 24 hours to the end so the result is positive.
-
Read every output format
Duration mode shows HH:MM, total minutes, total seconds, and decimal hours side by side. Use HH:MM for human-readable reports, minutes or seconds for scripts and spreadsheets, and decimal hours for payroll and invoices.
-
Copy the result to your clipboard
Click the copy control next to the format you need. Paste into your payroll system, timesheet, invoice line item, or spreadsheet cell.
-
Sanity-check against a known case
If a shift should be eight hours and the tool returns something different, re-check the midnight toggle and the start/end ordering. The tool deliberately errors on ambiguous ranges rather than silently guessing.
-
Apply your rounding rule if required
The tool returns the exact duration. If your employer or client rounds to the nearest quarter-hour, tenth-hour, or other increment, apply that rule to the decimal-hour result before submitting.
Time Duration Calculator FAQ
How do I calculate an overnight shift duration?
What are decimal hours?
How do I convert a duration to decimal for payroll?
Can I add 3.5 hours to a time?
Does the result wrap around midnight?
Why does the tool need a 'Crosses midnight' toggle — can't it figure it out?
Does it handle seconds?
Does the calculator account for daylight saving time (DST)?
Can I chain calculations?
Why does it fail when the start time is after the end time without the toggle?
Does it work for 12-hour (AM/PM) clocks?
Can I use negative minutes or hours?
Is it suitable for court reporting or legal billing?
How is this different from the Date Difference tool?
Is my time data logged or uploaded?
Background
The Kordu Time Duration Calculator does two jobs that every payroll clerk, consultant, shift worker, and project manager eventually needs: figuring out how long something took, and figuring out what time it will be after adding or subtracting a duration. Both look trivial on paper and both trip people up in practice — base-60 arithmetic, overnight wraparound, and decimal-hour conversion all have edge cases that silently corrupt timesheets if you do them by hand.
Two modes in one tool
Duration mode takes a start time and an end time in 24-hour HH:MM format and returns the duration in four formats simultaneously: HH:MM (e.g. 8:30), total minutes (510), total seconds (30600), and decimal hours (8.5). The four formats cover every downstream system you might paste into — HH:MM for human-readable reports, minutes or seconds for scripting and spreadsheet math, and decimal hours for payroll, billing rates, and invoice line items.
Add/subtract mode takes a start time plus a duration expressed as hours and minutes, and returns the resulting clock time. Adding 8 hours and 30 minutes to a 07:00 clock-in produces a 15:30 clock-out. Subtracting 45 minutes of prep time from a 14:00 deadline produces a 13:15 start time. The result wraps around midnight correctly in both directions: adding 5 hours to 21:00 produces 02:00 (not an error, not 26:00), and subtracting 3 hours from 01:00 produces 22:00 the previous day.
Why precise time math matters
Payroll is the highest-stakes case. A single shift miscalculated by fifteen minutes, repeated across thirty employees and twenty-six pay periods, compounds into thousands of dollars of payroll error every year. Hourly contractor billing has the same problem — a consultant tracking six concurrent engagements cannot afford the cumulative drift of mental arithmetic across a week of five-minute clock-ins. The same math powers shift scheduling, cooking and baking timers, interval training sessions, study blocks, meeting lengths, fasting windows, medication intervals, and any other task where "how long" or "when will it end" has to be right.
Decimal hours, explained
Clock time is base-60 (sixty minutes to the hour), but almost every payroll, accounting, and project-tracking system multiplies by a flat rate per hour — a base-10 operation. That mismatch is why decimal hours exist. Eight hours and thirty minutes is 8.5 hours because thirty minutes is 0.5 of an hour; seven hours and forty-five minutes is 7.75 hours because forty-five minutes is 0.75 of an hour (45 ÷ 60). Fifteen minutes is 0.25, twenty minutes is 0.333…, ten minutes is 0.1666…. Converting in your head is error-prone, which is why Harvest, Toggl, Clockify, QuickBooks Time, ADP, and essentially every other time-tracking and payroll platform export decimal hours by default. The calculator shows decimal hours alongside HH:MM so you can copy the right format into whichever system you're feeding.
Overnight shift math — why "Crosses midnight" exists
A naïve end − start calculation fails the moment a shift crosses midnight. 22:00 to 06:00 is eight hours of work, but 06:00 − 22:00 as raw numbers is −16 hours. The fix is to add 24 hours to the end time when the shift wraps past midnight, giving 30:00 − 22:00 = 8:00. That's exactly what the "Crosses midnight" toggle does. Flip it on for any range where the end time is numerically earlier than the start time: hospital night shifts (19:00 to 07:00), bar and restaurant close-down (23:30 to 03:00), warehouse graveyards (23:00 to 07:00), long-haul driving legs (21:00 to 05:00), or any weekend DJ set that runs into the small hours. Without the toggle, a midnight-crossing range returns an error rather than a silently wrong negative — the tool refuses to guess on your behalf so you don't accidentally pay someone for negative time.
Add/subtract use cases
Add mode answers "what time will my shift end?" (clock-in + shift length), "when does my Pomodoro finish?" (now + 25 minutes), "what's the deadline if I start now and the task takes 4 hours?", and "when should I take my next dose if the interval is 6 hours?". Subtract mode answers "what time do I need to leave?" (arrival − travel time), "when should I start prep?" (deadline − prep duration), and "what time was 90 minutes ago?". Both modes respect the 24-hour clock, so 00:00 and 23:59 wrap cleanly in either direction.
Payroll rounding conventions
Different jurisdictions and employers round differently. Some round clock-ins to the nearest quarter-hour (7-minute rule: 0–7 minutes round down, 8–14 round up), others use tenth-hour rounding (every six minutes), and many modern systems bill to the exact minute. This calculator does not round — it returns the exact duration so you can apply your employer's or client's rounding rule consciously rather than inheriting whatever a spreadsheet decides. If your contract says "billed in 15-minute increments," take the decimal-hour result and round up to the next 0.25.
24-hour vs 12-hour formats
The tool uses 24-hour HH:MM input to eliminate AM/PM ambiguity — 7:00 is unambiguous as "morning" only with the AM suffix, and at shift-handover time that suffix is exactly where mistakes happen. If your source data is in 12-hour format, convert 1 PM through 11 PM by adding 12 (1 PM = 13:00, 11 PM = 23:00) and keep 12 AM as 00:00 and 12 PM as 12:00.
Edge cases and common mistakes
If the start and end time are equal, the duration is 0:00 — fine for a canceled appointment, suspicious for a logged shift. If the start is later than the end and you forget the midnight toggle, the tool returns a clear error rather than silently producing a negative number. If you're chaining calculations (shift + overtime + travel), do the arithmetic in minutes or decimal hours and convert back to HH:MM at the end — adding HH:MM values directly requires carrying the sixty-minute rollover manually, which is exactly the error the tool exists to prevent.
Spreadsheet time math for comparison
Excel and Google Sheets store dates and times as fractions of a day, so
=END-START between two time cells returns a fractional-day value.
Formatting the result cell as [h]:mm (square brackets are critical — they
tell the spreadsheet to allow durations over 24 hours) gives you HH:MM.
Multiplying by 24 gives decimal hours; multiplying by 1440 gives total
minutes. The tool gives you all three without the format-cell dance.
Where this fits in a time-tracking workflow
Use this calculator as a sanity-check when reconciling timesheet totals, when a Toggl or Harvest export needs a one-off manual entry, when a client asks "what did I bill you for on the 14th?", or when you need to convert between formats to paste into a payroll system that only accepts decimal hours. It pairs naturally with the Kordu Date Difference tool (for multi-day spans), the Stopwatch and Pomodoro Timer (for live tracking), the Timezone Converter (for cross-region meetings), and the Salary to Hourly Calculator (to turn tracked decimal hours into dollar amounts).
Privacy and data processing
Every calculation runs client-side in your browser using plain JavaScript. Kordu does not log, transmit, or store the times you enter, the durations you compute, or any other data. The tool works offline once the page has loaded and has no rate limits, signup walls, or third-party trackers reading your inputs.
Related tools
Date Difference Calculator
Calculate the exact difference between two dates in years, months, days, and business days.
Timezone Converter
Convert times between timezones and compare up to four zones side by side.
Stopwatch
Precise stopwatch with lap times, split tracking, and millisecond accuracy.
Countdown Timer
Live countdown to any target date or duration with presets, alerts, pause/resume, reminders, and persistence.
Business Days Calculator
Count business days between two dates or add working days to a date. Excludes weekends. Perfect for net-30 invoicing, SLAs, and project deadlines.
World Clock
Live world clock showing the current time in major cities. Add any IANA timezone, remove what you don't need, updates every second.
Salary to Hourly Calculator
Convert annual salary to hourly rate or hourly rate to salary with a full pay breakdown.
Timestamp Converter
Convert Unix timestamps to human-readable dates or dates to epoch timestamps — with timezone support and multiple formats.