Time Card Calculator

Time Card Calculator API

Utilities

Fill in a weekly timesheet with start and end times and breaks, including overnight shifts, and get daily and weekly hours, overtime and gross pay.

Authentication

Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.

Rate Limit

120 requests per minute

Endpoints

1 endpoint available

Overview

Turns a week of start and end times into worked hours, split into regular, overtime and double time, with optional gross pay. List the days in week order, up to 7. Each day has a start, an end and an unpaid break. A day with nothing in it is allowed and counts as 0 hours.

Times

  • Times can be typed loosely: 9, 930, 5p, 9:30 pm, 17:45, 9.30, noon, midnight.
  • Shifts that run past midnight are handled (10pm to 6 is 8 hours).
  • With guessAmPm true (the default), an end time with no am or pm is read the way that makes the shorter shift, so 9 to 5 is 8 hours, not 20. Break times are read as falling inside the shift. Set it to false if you send 24-hour times and want them taken literally.
  • Times in the response are 24-hour HH:MM.

Breaks

Give breakMinutes (unpaid minutes), or breakStart and breakEnd, not both. The break must fit inside the shift.

Overtime

  • overtimePreset: none (default), ontario (44 h a week), us-federal (40 h a week), california (overtime after 8 h a day or 40 h a week, double time after 12 h a day; the seventh-consecutive-day rule is not included) or custom. These are simplified and are not legal advice.
  • With custom, set any of dailyLimitHours, doubleTimeLimitHours (double time after this many hours in a day) and weeklyLimitHours. The limits only work with custom.
  • Daily limits apply first. The weekly limit then counts only the hours still at the regular rate, in the order the days are listed, so an hour is never overtime twice.

Pay

If hourlyRate is above 0, pay has regular, overtime, double time and total in dollars, rounded half up to the cent. Overtime pays overtimeMultiplier (default 1.5) and double time doubleTimeMultiplier (default 2), to 3 decimal places. Otherwise pay is null.

Hours come as whole minutes (exact) and as decimal hours rounded to 2 places. A bad time or break returns a 400 error that names the day, like days[2]: "xx" isn't a time.

If you send startDate, the date of the first day, each day also gets its date and weekday.

Endpoints

POST
https://opentools.ca/api/v1/tools/time-card-calculator
Add up a week of shifts into hours, overtime and gross pay

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
days
array
Required
Days in week order, 1 to 7.
days[].label
string
OptionalA label for the day, returned as sent.
days[].start
string
OptionalStart time, such as "9a" or "17:45". Leave start, end and breaks empty for a day off.
days[].end
string
OptionalEnd time. Needed when start is given.
days[].breakMinutes
number
OptionalUnpaid break in minutes, 0 to 1440.
days[].breakStart
string
OptionalStart of the unpaid break. Use with breakEnd.
days[].breakEnd
string
OptionalEnd of the unpaid break. Use with breakStart.
startDate
string
OptionalDate of the first day, YYYY-MM-DD. Adds a date and weekday to each day.
guessAmPm
boolean
OptionalRead times with no am or pm the way that gives the shorter shift.Default: true
overtimePreset
string
Enum: ontario, us-federal, california, none, custom
OptionalOvertime rules to apply.Default: none
dailyLimitHours
number
Optionalcustom only. Hours in a day before overtime.
doubleTimeLimitHours
number
Optionalcustom only. Hours in a day before double time.
weeklyLimitHours
number
Optionalcustom only. Regular hours in the week before overtime.
hourlyRate
number
OptionalHourly pay in dollars. Adds pay to the response.
overtimeMultiplier
number
OptionalPay multiplier for overtime hours.Default: 1.5
doubleTimeMultiplier
number
OptionalPay multiplier for double time hours.Default: 2

Response Example

{
  "success": true,
  "overtime": {
    "preset": "california",
    "dailyLimitHours": 8,
    "doubleTimeLimitHours": 12,
    "weeklyLimitHours": 40
  },
  "days": [
    {
      "day": 1,
      "label": "Mon",
      "date": "2026-11-23",
      "weekday": "Monday",
      "empty": false,
      "start": "09:00",
      "end": "17:30",
      "overnight": false,
      "breakStart": null,
      "breakEnd": null,
      "breakMinutes": 30,
      "workedMinutes": 480,
      "regularMinutes": 480,
      "overtimeMinutes": 0,
      "doubleTimeMinutes": 0,
      "workedHours": 8,
      "regularHours": 8,
      "overtimeHours": 0,
      "doubleTimeHours": 0
    },
    {
      "day": 2,
      "label": "Tue",
      "date": "2026-11-24",
      "weekday": "Tuesday",
      "empty": false,
      "start": "08:30",
      "end": "18:00",
      "overnight": false,
      "breakStart": null,
      "breakEnd": null,
      "breakMinutes": 45,
      "workedMinutes": 525,
      "regularMinutes": 480,
      "overtimeMinutes": 45,
      "doubleTimeMinutes": 0,
      "workedHours": 8.75,
      "regularHours": 8,
      "overtimeHours": 0.75,
      "doubleTimeHours": 0
    }
  ],
  "totals": {
    "breakMinutes": 75,
    "workedMinutes": 1005,
    "regularMinutes": 960,
    "overtimeMinutes": 45,
    "doubleTimeMinutes": 0,
    "workedHours": 16.75,
    "regularHours": 16,
    "overtimeHours": 0.75,
    "doubleTimeHours": 0
  },
  "hourlyRate": 28.5,
  "pay": {
    "regular": 456,
    "overtime": 32.06,
    "doubleTime": 0,
    "total": 488.06
  }
}

Error Codes

400
Bad Request - A time cannot be read, a break is outside the shift, or the overtime fields do not fit the preset
401
Unauthorized - Missing or invalid API key
403
Forbidden - The API key is inactive or expired, or the request IP is not allowed
405
Method Not Allowed - This endpoint accepts POST only
429
Too Many Requests - Rate limit exceeded (120 requests per minute per API key)
500
Internal Server Error

Code Examples

# Two days with California overtime rules
curl -X POST https://opentools.ca/api/v1/tools/time-card-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "days": [
    {
      "label": "Mon",
      "start": "9a",
      "end": "5:30p",
      "breakMinutes": 30
    },
    {
      "label": "Tue",
      "start": "8:30",
      "end": "6p",
      "breakMinutes": 45
    }
  ],
  "startDate": "2026-11-23",
  "overtimePreset": "california",
  "hourlyRate": 28.5
}'

Ready to get started?

Create an API key to start using the Time Card Calculator API.

Rather use it in your browser? Open the Time Card Calculator