Hours Calculator — Find the Exact Time Between Any Two Dates
Enter a start and an end. Get total hours, minutes and seconds with a readable breakdown.
Plus timesheet totals, duration maths and working days — all handled in your browser.
Updated: August 24, 2026 Built by Khalil Rahman 100% client-side Free forever
Pick a start and end moment. Handles different days, crossing midnight, and long gaps of months or years.
Start
End
Total Duration
—
0Days
0Hours
0Minutes
0Seconds
Total hours0
Total minutes0
Total seconds0
Decimal hours (for invoices)0
Full days0
Add a row for each shift. Breaks are entered in minutes and subtracted from that row. Handles overnight shifts when the end time is earlier than the start time.
Total time worked
—
0Days
0Hours
0Minutes
0Shifts
Total hours (decimal)0
Total minutes0
Estimated pay0
Start from a moment in time and add or subtract a duration. Useful for scheduling, deadlines and "what time will it be in 90 minutes".
Starting moment
Duration
Resulting moment
—
Full date & time—
Day of the week—
Time elapsed from start—
Counts business days between two dates, excluding weekends and any public holidays you add.
From
To
Working days
—
Calendar days0
Weekend days0
Holidays on weekdays0
Working days0
Working weeks (approx.)0
What this calculator actually does
You give it two moments in time — say Monday 9:00 AM and Friday 5:30 PM — and it tells you the exact gap
between them. Not "about four days" or "roughly a hundred hours", but the precise number of days, hours,
minutes and seconds, plus the raw totals if you need those instead.
Most online calculators either can't handle time of day, or they give you a weird decimal like "104.5 hours"
and leave it there. This one shows both: the human version and the number you'd put on an invoice.
Four tabs cover the four jobs people actually need — measuring a gap, totalling a timesheet, doing
duration maths, and counting working days.
How to use each tab
Time Difference
1
Pick the start date and start time in the left box.
2
Pick the end date and end time in the right box.
3
If you only need working hours, tick the box for Mon–Fri, 09:00–17:00.
4
Press Calculate and read the breakdown below.
Timesheet Total
Each row takes a start time, an end time and a break in minutes. Rows where the end is earlier than the
start are treated as overnight shifts and 24 hours are added automatically. The panel shows the grand total
as days, hours and minutes, plus a decimal figure ready for invoicing. If you enter an hourly rate, it also
estimates pay.
Add / Subtract
Pick a starting moment and enter a duration in days, hours, minutes and seconds. Choose whether to add or
subtract. Useful for things like "what time is it ninety minutes from now" or "what's the date 45 days
before the deadline".
Working Days
Counts business days between two dates, skipping Saturdays and Sundays. Add your public holidays — one per
line in YYYY-MM-DD format — and they'll be excluded too. Weekends that fall on a holiday are
not double counted.
💡 Pro tip: Want to know how many hours between 9 AM and 5 PM today? Set both dates to
today. The calculator doesn't care about the date if it's the same one on both sides.
Who actually uses a tool like this
More people than you would guess. Here is what the four tabs get used for every day:
💼
Freelancers billing hours
Turn a week of client work into an exact decimal figure for the invoice, with breaks already deducted.
🛫
Travel and flight planning
See the real elapsed time between departure and arrival, including long layovers.
🎓
Study and deadlines
Know exactly how many working days remain before a submission, without counting weekends by hand.
🏃
Event countdowns
How many hours until the wedding, the launch or the big match? Now you know precisely.
💻
Developers and shift workers
Measuring uptime windows, shift lengths and gaps between two log timestamps.
🏋️
Fitness and sleep tracking
How long was the workout? How many hours did you actually sleep? Real numbers instead of guesses.
The maths behind it (it really is simple)
Every date and time on a computer is stored as a single number — the count of milliseconds since
1 January 1970. That is called a Unix timestamp, and it is how almost every device in the world keeps track
of time.
So when you enter two dates, this calculator does three things:
Converts both moments to their timestamp number.
Subtracts the start from the end to get the difference in milliseconds.
Divides that difference into days, hours, minutes and seconds so it is readable.
That is the whole trick. No rounding, no approximation. The number you see is the exact gap.
Converting to decimal hours
Take the minutes, divide by 60, and add them to the hours. So 7 hours 45 minutes becomes
7 + (45 ÷ 60) = 7.75. The Timesheet tab does this for every row automatically, because that is
the form most invoicing systems expect.
⚠️ One thing to know about time zones: the calculator uses your device's local time zone.
If you are comparing moments in two different zones — for example a call between Karachi and New York —
use the Time Zone Converter instead, which handles the offset for you.
Your privacy and how we handle data
Your times never leave your device. Every calculation runs as JavaScript in your browser.
Nothing you type into the date or time fields is uploaded, stored or logged anywhere. There is no server
processing your input.
Nothing is saved between visits. Refresh the page and the fields reset. We do not use
localStorage, sessionStorage or cookies to remember your entries.
Cookies and advertising. Advertising and analytics cookies are switched off by default.
They only turn on if you press Accept all, or if you choose them individually in
Manage preferences. You can change your mind at any time from the
Cookie Policy page. Full details are in our
Privacy Policy.
About the author
KR
Khalil Rahman — Front-end developer and tool builder
Khalil has spent the last eight years building browser-based
utilities for freelancers, designers and developers. He built this calculator after losing count one
too many times while invoicing hourly work, and he maintains the SkillsInsider time and productivity
toolset.
Does the hours calculator count weekends or holidays?
The Time Difference tab counts pure elapsed time, so weekends and holidays are included. If you need to
exclude them, use the Working Days tab — tick the option to include or exclude the start date and paste
in any public holidays you want removed.
Can it handle times that cross midnight?
Yes. Set the end date to the following day. For example, comparing 10 PM on Tuesday to 6 AM on Wednesday
gives exactly 8 hours. In the Timesheet tab, if the end time is earlier than the start time, the row is
automatically treated as an overnight shift.
What happens if the end is before the start?
The calculator shows the duration with a minus sign in front. That usually means the start and end were
swapped — just flip them and try again.
How do I convert the result to decimal hours for an invoice?
The decimal figure is shown in the totals box automatically for both the Time Difference and Timesheet
tabs. The formula is hours + (minutes ÷ 60), so 7 hours 30 minutes becomes 7.5.
Why is the "total hours" number sometimes much bigger than the breakdown?
Because it counts every hour rather than just the leftover after whole days are broken out. A three-day
gap shows "3 days, 0 hours" in the breakdown, but "72 hours" in the totals — the same amount expressed
two different ways.
Does it account for daylight saving time?
The calculator uses your device's local time zone. If a daylight saving change falls inside the range you
are measuring, the elapsed clock time is still correct, but the wall-clock difference across the change
may be one hour more or less than a naive subtraction would suggest.
Is my data sent anywhere?
No. Every calculation runs in your browser using JavaScript. Nothing gets uploaded, stored, tracked or
shared. Close the tab and it is gone.
Can I use this for payroll?
It gives you accurate elapsed-time totals and decimal hours, which is what most payroll systems need.
However, always check your local employment rules — overtime multipliers, statutory breaks and rounding
conventions vary, and this tool does not apply any of those automatically.
We use strictly necessary cookies to make the site work. With your permission we also use analytics,
advertising and functional cookies to keep the tools free and improve them. You can accept everything,
reject the extras, or choose individually. Read the
Cookie Policy and
Privacy Policy for full details.
Strictly necessary
Required to load the page and remember your cookie choice. These cannot be switched off.
Analytics
Anonymous statistics about which pages and tools are most used, so we know what to improve.
Advertising
Allows us to show relevant ads and keep the tools free. Personalised ads use data shared with ad partners.
Functional
Remembers things like your dark/light theme and recently used tools for a smoother experience.