Skip to content
Kordu Tools
Time & Date Runs in browser Updated 18 Apr 2026

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

Duration08:30
Total minutes510
Total seconds30,600
Decimal hours8.5000
Loading rating…

How to use Time Duration Calculator

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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?

Enter the shift start time (e.g. 22:00) and end time (e.g. 06:00), then enable the 'Crosses midnight' toggle. The calculator adds 24 hours to the end time and correctly returns 8 hours instead of a negative value. Use the toggle for any range where the end time is numerically earlier than the start — 23:30 to 07:30, 19:00 to 04:00, and so on.

What are decimal hours?

Decimal hours express a duration as a single number instead of hours and minutes. Eight hours and thirty minutes = 8.5 hours because 30 ÷ 60 = 0.5. Seven hours and forty-five minutes = 7.75 hours because 45 ÷ 60 = 0.75. Fifteen minutes = 0.25, twenty minutes ≈ 0.333. Payroll systems, accounting software, and invoicing tools prefer decimal hours because multiplying by a flat hourly rate is straightforward base-10 math.

How do I convert a duration to decimal for payroll?

Take the minutes portion and divide by 60. 45 minutes is 45 ÷ 60 = 0.75, so 7:45 is 7.75 hours. The calculator does this for you automatically and shows the decimal-hour value next to the HH:MM result — copy whichever format your payroll system expects.

Can I add 3.5 hours to a time?

Yes. Switch to 'Add / subtract time' mode, enter your start time, set hours to 3 and minutes to 30, and pick Add. The result appears instantly. For subtraction, pick Subtract instead — don't enter a negative duration.

Does the result wrap around midnight?

Yes. In add/subtract mode the clock wraps correctly in both directions. Adding 5 hours to 21:00 produces 02:00, not 26:00 or an error. Subtracting 3 hours from 01:00 produces 22:00. The tool handles midnight as a seamless clock boundary.

Why does the tool need a 'Crosses midnight' toggle — can't it figure it out?

The toggle is explicit on purpose. A 06:00–22:00 range could mean 'from 6 AM to 10 PM' (16 hours, same day) or 'from 6 AM one day to 10 PM the next' (40 hours). Auto-detecting overnight ranges risks silently adding 24 hours to a same-day entry. The toggle forces a conscious choice so your timesheet can't quietly double-count a shift.

Does it handle seconds?

Input is HH:MM precision (whole minutes). Output includes total seconds as a derived value — useful when you need to paste a duration into a system that measures in seconds. If you need second-precision input, use the Kordu Stopwatch for live timing instead.

Does the calculator account for daylight saving time (DST)?

No. The calculator treats times as clock-face values, so it will not add or subtract the extra hour that happens on DST transition nights. If your shift spans a DST changeover, calculate the before- and after-transition portions separately and add them. For multi-day date math use the Date Difference tool.

Can I chain calculations?

Yes. Compute the first duration, then feed the result into the next calculation. For complex chains (shift + overtime + break deduction), do the arithmetic in total minutes or decimal hours and convert back to HH:MM at the end — adding HH:MM values directly requires manually carrying the sixty-minute rollover and is the main source of hand-calculated errors.

Why does it fail when the start time is after the end time without the toggle?

Deliberately. A range like 22:00–06:00 without the midnight toggle is ambiguous — the literal subtraction is negative, which is never a valid duration. The tool returns an error prompting you to enable 'Crosses midnight' rather than silently returning a wrong value. That's a feature: better a visible error than an invisible payroll mistake.

Does it work for 12-hour (AM/PM) clocks?

The tool uses 24-hour HH:MM to avoid AM/PM ambiguity, which is a common source of shift-handover errors. Convert 12-hour values to 24-hour by adding 12 to PM times from 1 PM to 11 PM (1 PM = 13:00, 11 PM = 23:00). Keep 12 AM as 00:00 and 12 PM as 12:00.

Can I use negative minutes or hours?

No. Use the Subtract operation in add/subtract mode instead. The inputs accept only non-negative whole numbers — this prevents sign errors that can creep in when a spreadsheet formula unexpectedly returns a negative duration.

Is it suitable for court reporting or legal billing?

It's suitable for the arithmetic — the result is exact to the minute and the decimal-hour output matches standard billing conventions. For court-reporting, legal, or medical records where an auditable timestamp trail matters, pair it with a dedicated time-tracking system of record and use this tool as a reconciliation and conversion check.

How is this different from the Date Difference tool?

This calculator works on clock times within a 24-hour window (or one overnight wrap). The Date Difference tool calculates spans across calendar dates — weeks, months, years — including business-day counts. Use this one for shifts and intervals; use Date Difference for project timelines and age-style calculations.

Is my time data logged or uploaded?

No. Every calculation runs client-side in your browser with plain JavaScript. Kordu does not transmit, store, or log the times you enter or the durations you compute. The tool works offline once the page has loaded, and there are no third-party trackers reading the inputs.

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.