Hours Calculator · work & duration

Hours Calculator

Calculate work hours, time duration, add/subtract hours

minutes
9–5 (8h) 8–4 (8h) Morning (3h) Afternoon (4h)
+8h (work day) +12h (half day) +24h (next day) +40h (work week)
Result hours
8 hours 0 minutes
From 2025-01-01 09:00 to 2025-01-01 17:00
Click copy to save result
Hours Calculation Guide
Duration
Difference between two times, optionally subtract break.
End − Start − Break
Add/Subtract
Add or subtract hours from a base datetime.
Base ± Hours
Work Hours
Standard workday: 9 AM – 5 PM = 8 hours.
9–5 = 8h
Overnight
Calculations correctly handle crossing midnight.
Always positive duration
Common Hour Calculations

Creator & Maintainer

Image of Faiq Ur Rahman, CEO & Founder Toolraxy

Faiq Ur Rahman

Founder & CEO, Toolraxy

Faiq Ur Rahman is a web designer, digital product developer, and founder of Toolraxy, a growing platform of web-based calculators and utility tools. He specializes in building structured, user-friendly tools focused on health, finance, productivity, and everyday problem-solving.

Share:

Rate this Tool

User Ratings:

0.0
0.0 out of 5 stars (based on 0 reviews)
Excellent0%
Very good0%
Average0%
Poor0%
Terrible0%

ADVERTISEMENT

ADVERTISEMENT

What Is This Hours Calculator?

This Hours Calculator is a dual-mode time tool that helps you perform two essential time calculations:

  1. Duration Mode: Find the exact hours and minutes between two dates and times, with optional break subtraction

  2. Add/Subtract Mode: Add or subtract hours from any starting date and time to find future or past moments

Unlike simple time calculators, this tool handles overnight shifts, accounts for breaks automatically, and lets you work in familiar datetime formats without mental math.

 

Why This Tool Matters

Time is money—especially when you’re billing by the hour, tracking payroll, or managing project deadlines. Yet manual time calculation is notoriously error-prone:

  • Forgetting to subtract lunch breaks from work hours

  • Miscounting when shifts cross midnight

  • Confusion between 12-hour and 24-hour formats

  • Adding hours without accounting for date changes

This calculator eliminates these errors in seconds. One click gives you accurate, break-adjusted hours that you can copy directly into timesheets, invoices, or project plans.

 

How to Use This Tool

Mode 1: Calculate Duration Between Two Times

Step 1: Select “Duration” tab
Step 2: Choose your start date and time
Step 3: Choose your end date and time
Step 4: (Optional) Check “Subtract break time” and enter break minutes
Step 5: Click Calculate or use preset shifts

Result: Total hours and minutes displayed instantly

 

Mode 2: Add or Subtract Hours

Step 1: Select “Add / Subtract” tab
Step 2: Choose your base date and time
Step 3: Select “Add” or “Subtract”
Step 4: Enter the number of hours
Step 5: Click Calculate or use preset amounts

Result: New date and time displayed

 

Quick Features

  • Preset Shifts: Click 9–5, 8–4, or other common shifts

  • Now Button: Auto-fill current time for real-time calculations

  • Copy Button: Copy results to clipboard for timesheets

  • Reset Button: Restore default values

 

How It Works (The Formula Explained)

Duration Calculation Logic

The calculator finds the difference between two moments in time:

Step 1: Convert both dates to milliseconds since Jan 1, 1970
Step 2: Subtract start from end → total milliseconds
Step 3: Divide by 60,000 → total minutes
Step 4: Subtract break minutes (if any)
Step 5: Convert to hours and minutes

 

Example: 9:00 AM to 5:00 PM with 30-minute break

  • Total time: 8 hours (480 minutes)

  • Subtract break: 480 – 30 = 450 minutes

  • Result: 7 hours 30 minutes worked

 

Add/Subtract Logic

New Time = Original Time + (Hours × 3,600,000 milliseconds)

 

The calculation automatically handles:

  • Rolling to the next day when hours exceed 24

  • Rolling to previous day when subtracting past midnight

  • Month and year boundaries (Jan 31 + 24 hours = Feb 1)

 

Why Milliseconds?

All modern computers track time in milliseconds since January 1, 1970 (Unix Epoch). Using this standard ensures perfect accuracy across days, months, and years—no manual calendar math required.

 

Real-Life Examples

Example 1: Employee Timesheet

Scenario: You work 9:15 AM to 6:30 PM with a 45-minute lunch break

Using the tool:

  1. Duration mode: Start 09:15, End 18:30

  2. Check break, enter 45 minutes

  3. Calculate → 8 hours 30 minutes worked

Without the tool, you might forget the break or miscalculate the 45 minutes.

 

Example 2: Project Deadline

Scenario: A project starts Monday 10:00 AM and requires 24 hours of work

Using the tool:

  1. Add/Subtract mode: Base = Monday 10:00

  2. Operation = Add, Hours = 24

  3. Calculate → Tuesday 10:00 AM

The tool automatically advances to the next day.

 

Example 3: Overnight Shift

Scenario: Night shift from 10:00 PM to 6:00 AM next day

Using the tool:

  1. Duration mode: Start 22:00, End next day 06:00

  2. Calculate → 8 hours 0 minutes

The tool recognizes the date change automatically.

 

Example 4: Freelance Billing

Scenario: Multiple short tasks totaling 3.5 hours with no breaks

Using the tool:

  1. Add/Subtract mode: Start 09:00

  2. Add 3.5 hours → 12:30 PM

Copy the result directly to your invoice.

 

Benefits

BenefitHow It Helps
Break SubtractionNever forget lunch or coffee breaks again
Overnight HandlingPerfect for night shifts and graveyard hours
Dual ModesDuration for tracking, Add/Subtract for planning
Preset ShiftsOne-click common work schedules
Copy-ReadyPaste directly into timesheets or invoices
Now ButtonReal-time calculations without typing

 

Who Should Use This Tool

Employees & Hourly Workers
Track your exact hours worked including breaks. Verify your paycheck matches your time.

Freelancers & Consultants
Calculate billable hours accurately. Show clients precise time breakdowns.

HR & Payroll Staff
Process timesheets faster. Verify overtime calculations without spreadsheets.

Project Managers
Estimate task durations. Schedule deadlines across time zones.

Students
Track study sessions. Plan project work across multiple days.

Event Planners
Calculate event durations. Schedule setup and breakdown times.

Healthcare & Shift Workers
Track overnight shifts. Calculate break compliance.

 

Common Mistakes to Avoid

1. Forgetting to Subtract Breaks
Many people calculate total hours but forget unpaid breaks. Always check the break box for accurate work hours.

2. Confusing AM and PM
The datetime-local input uses 24-hour format (15:00 = 3:00 PM). Verify your entries before calculating.

3. Ignoring Date Changes
Adding 24 hours to Monday 10:00 gives Tuesday 10:00, not Monday 10:00 again. The tool handles this, but be aware when planning.

4. Wrong Break Format
Break minutes are in minutes, not hours. 30 minutes = 30, not 0.5.

5. Negative Durations
If end time is before start time, the tool shows zero. Always ensure chronological order.

 

Limitations

Time Zone Handling
This calculator uses your browser’s local time settings. If you’re calculating across time zones, verify your system time is correct.

Seconds Precision
Calculations work to the minute level. For second-precision needs (like scientific logging), use specialized timestamp tools.

Maximum Values
Hours inputs are capped at 999 hours (about 41 days). For longer periods, calculate in segments.

Break Maximum
Break minutes are limited to 300 (5 hours) to prevent unrealistic entries.

Understanding Decimal Hours vs. Hours:Minutes

Payroll systems often use decimal hours (7.5 hours) while people think in hours:minutes (7:30). To convert: divide minutes by 60. 30 minutes ÷ 60 = 0.5 hours. So 7 hours 30 minutes = 7.5 hours. This calculator shows both formats—use whichever your system requires.

 

The 9-to-5 Workday Explained

The standard 8-hour workday (9:00 AM to 5:00 PM) became common during the Industrial Revolution when labor movements fought for 8-hour work shifts. It includes a 1-hour unpaid lunch break, making it 8 paid hours from 9–5. This is why many companies still use “9-to-5” to mean full-time work.

 

Overnight Shift Calculations

When shifts cross midnight, manual calculation often fails. The correct method: add 24 hours to the end time, then subtract start time. Example: 10:00 PM to 6:00 AM = (6:00 + 24:00) – 22:00 = 30:00 – 22:00 = 8:00. Our calculator does this automatically.

 

Billable Hours Best Practices

Freelancers and consultants should track time in 6-minute (0.1 hour) or 15-minute (0.25 hour) increments. Always round consistently—either always up or using standard rounding rules. Never round down on client work.

 

FLSA Overtime Rules (US)

US labor law requires overtime pay (1.5× normal rate) for hours worked beyond 40 in a workweek. Some states have daily overtime rules. Always verify your jurisdiction’s requirements. This calculator helps track totals, but consult HR for compliance.

 

Time Tracking Methods

Three common approaches: manual timesheets, time tracking apps, and project management software. Each has tradeoffs between accuracy and convenience. Many professionals use this calculator to verify app-generated totals.

Faqs

How do I calculate hours between two times?

Select the Duration tab, enter your start and end times, and click Calculate. The tool shows total hours and minutes instantly. Use the break option if needed.

Switch to the Add/Subtract tab, enter your base date and time, select “Add,” enter the hours, and click Calculate. The new time appears with date automatically adjusted.

Yes. If your end time is on the next day (like 10:00 PM to 6:00 AM), the calculator detects the date difference and returns the correct overnight duration.

Absolutely. Check “Subtract break time” and enter your break minutes. The final result automatically deducts your break from total hours.

Duration finds elapsed time between two moments. Add/Subtract starts from one moment and projects forward or backward by a specific number of hours.

Accuracy is to the minute level, based on your computer’s system clock. For payroll and timesheet purposes, this exceeds typical requirements.

Yes. Many payroll professionals use this tool to verify timesheet totals. Always round according to your company’s policy (nearest quarter-hour, etc.).

ADVERTISEMENT

ADVERTISEMENT