Decimal time conversion
Seven and a half hours on a timesheet is 7:30:00, and 1 hour 15 minutes is 1.25 decimal hours. Convert any duration either way between decimal hours and hours, minutes and seconds, with no wrap at midnight. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Decimal hours
- 2.5
- Converted
- 02:30:00
- Direction
- To hms
- Hours
- 2
- Minutes
- 30
Payroll systems, timesheets, aviation logs, and lab notebooks often store a duration as a decimal number of hours, while people read the same span as hours, minutes, and seconds. Seven and a half hours on a timesheet is 7:30:00 on a clock face; one hour and fifteen minutes in a log is 1.25 decimal hours in a spreadsheet. This decimal time conversion tool turns one representation into the other with pure sexagesimal arithmetic: the fractional part of a decimal hour is multiplied by sixty to obtain minutes, then the leftover fraction is multiplied by sixty again to obtain seconds. In the other direction, minutes are divided by sixty and seconds by three thousand six hundred so they add back into a single decimal hour.
What decimal time conversion actually computes
Decimal hours and hours-minutes-seconds are two writings of the same duration, not two different clocks and not a time of day. A decimal hour such as 2.5 means two whole hours plus five-tenths of an hour. Because one hour contains sixty minutes, five-tenths of an hour is thirty minutes, so 2.5 decimal hours is 2 hours 30 minutes 0 seconds.
The reverse walk is equally mechanical: two hours plus thirty minutes plus zero seconds is 2 + 30/60 + 0/3600, which equals 2.5. The converter never consults a system clock, a time zone, or a calendar; it does not wrap at twenty-four hours, because a timesheet can legally hold 36.25 hours in a week. Whole hours come from the integer part of the decimal.
Minutes come from the floor of the leftover fraction times sixty. Seconds come from the leftover after minutes, times sixty, with a stable carry so that a float that lands just under sixty seconds becomes the next minute instead of an ugly residue. Minutes or seconds larger than fifty-nine are accepted and carried: ninety minutes is one and a half hours, not an error.
That matches payroll sheets where someone typed 1 hour 90 minutes instead of 2 hours 30 minutes. Negative components are rejected because a negative duration is not a convertible time in this tool.
Where a decimal-hours converter earns its keep
Payroll clerks convert decimal hours from a badge system into HH:MM:SS so a pay stub matches the clock the worker saw. Aviation and lab logs go the other way: a sortie or an incubation recorded as 1:20:00 becomes 1.333 decimal hours in a spreadsheet that only adds decimals. Teachers and exam-prep sites need a deterministic oracle that marks 2.75 hours as 2:45:00, not as 2 hours and 74 leftover minutes from a sloppy multiply.
Unlike a time-of-day adder, this tool does not wrap at midnight and does not emit a day offset; 26.5 hours is a legal weekly total, not two in the morning. Unlike a unit converter that turns 90 minutes into 1.5 hours as a single from-to pair, this page speaks the pair of formats people actually search: decimal hours versus hours-minutes-seconds. Pair this converter with a clock-plus-hours tool when you need a finish time of day, and with a duration summer when you need to add several stopwatch blocks first.
What you can do with it
Payroll and timesheet stubs
Turn badge-system decimal hours into HH:MM:SS so a pay stub matches the clock the worker saw, or fold a handwritten 1 h 90 min line back into 2.5 hours.
Aviation, lab, and log books
Convert a sortie or incubation recorded as 1:20:00 into decimal hours for a spreadsheet that only adds decimals, without wrapping at midnight.
FAQ
How do I convert hours, minutes and seconds to decimal hours?
Send hours, and optionally minutes and seconds, as non-negative finite numbers.
What happens if a value is negative or not a number?
Negative durations and non-finite values (NaN, Infinity, booleans, objects) are rejected and are not billed.
Does 26.5 decimal hours wrap past midnight?
No. This converter treats the input as a duration, not a clock time of day. 26.5 hours becomes 26:30:00, which is a legal weekly timesheet total.
How do I turn decimal hours into hours and minutes?
Keep the whole number as hours and multiply the fraction by 60 to get minutes. For 2.75 hours that gives 2 hours and 45 minutes, written 2:45:00.
Can I enter 60 minutes or seconds or more?
Yes. Extra minutes and seconds are carried into the next unit, so 90 minutes counts as one and a half hours, and 1 hour 90 minutes becomes 2:30:00.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/life/decimal-time-conversion \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"decimal_hours":2.5}'const res = await fetch("https://api.kit.forhosting.com/life/decimal-time-conversion", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"decimal_hours": 2.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/life/decimal-time-conversion",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"decimal_hours": 2.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/life/decimal-time-conversion", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"decimal_hours":2.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"decimal_hours":2.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/life/decimal-time-conversion", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"decimal_hours": 2.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "life.decimal_time_conversion",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_hours | 1000000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Negative values and inputs that are not finite numbers are rejected with invalid_input and are not billed. Successful API calls use the published $0.002 base price.
Input contract, both directions, and the response shape
Magnitude is capped so a typo cannot request a million-hour span. Missing both sides of the conversion is a typed failure, not a zero result. POST a JSON body that names at least one side of the conversion. direction is an optional enum: auto (the default), to_hms, or to_decimal. In auto mode, a present decimal_hours field selects decimal-to-HMS; otherwise hours, minutes, and seconds select HMS-to-decimal. Aliases mode and convert are accepted for direction. decimal_hours is a non-negative finite number such as 2.5 or 8.75; aliases decimal, value, and hours_decimal are accepted. hours, minutes, and seconds are non-negative finite numbers; minutes and seconds default to zero when omitted. Aliases h and hr, m and min, and s and sec are accepted so spreadsheets can reuse column names. JSON numbers and numeric strings parse; booleans, arrays, objects, empty strings, Infinity, and NaN fail with invalid_input naming the field. A negative value on any numeric field fails with invalid_input; those failures are not billed. On success the body always returns both writings: decimal_hours, the normalized hours, minutes, and seconds after carry, an hms string such as 02:30:00, a converted string that matches the requested direction, total_seconds, the resolved direction, and a short formula. Example: decimal_hours 2.5 yields hours 2, minutes 30, seconds 0, hms 02:30:00, converted 02:30:00, and total_seconds 9000. Example: hours 1, minutes 15, seconds 0 yields decimal_hours 1.25, hms 01:15:00, and converted 1.25. Force direction when a payload might carry leftover fields from a previous form submit.
Where a decimal-hours converter earns its keep
On this page the work runs entirely in your browser; through the API each successful conversion costs $0.002, failed validation is not charged, and nothing is stored after the response returns.
Integration use cases
Homework keys and CI fixtures
Assert that 2.75 hours is 02:45:00 in exam keys and continuous-integration fixtures that must not depend on the machine clock.
Technical questions
How do I convert decimal hours to hours, minutes and seconds?
Send decimal_hours as a non-negative finite number (for example 2.5). The API returns hours, minutes, seconds and an hms string such as 02:30:00. direction may be omitted (auto) or set to to_hms.
What does decimal time conversion cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.