API, embed & AI access
A free, keyless JSON API for converting time, plus machine-readable docs for AI assistants and agents.
Updated · Formulas per our methodology
Convert time to decimal hours
Accepts H:MM, H:MM:SS or unit strings like 7h 45m 30s.
GET https://www.timetodecimalcalculator.com/api/convert?time=7:45
{
"input": "7:45",
"hours": 7, "minutes": 45, "seconds": 0,
"decimalHours": 7.75,
"decimalHoursRounded2": 7.75,
"totalMinutes": 465,
"totalSeconds": 27900,
"formula": "7 + 45 / 60 + 0 / 3600 = 7.75"
}Convert decimal hours to time
GET https://www.timetodecimalcalculator.com/api/convert?decimal=7.75
{
"input": 7.75,
"hours": 7, "minutes": 45, "seconds": 0,
"hhmmss": "07:45:00",
"text": "7 hours 45 minutes",
"totalMinutes": 465,
"totalSeconds": 27900
}Details
- No API key, CORS enabled for all origins, responses are cacheable.
- Errors return HTTP 400 with an
errormessage and usage examples. - OpenAPI 3.1 spec: /openapi.json
- Please be reasonable with request volume; for bulk work the formula is trivial to run locally.
Embed the calculator on your site
Free for any website, intranet or payroll guide. Paste this where you want the calculator to appear; please keep the credit link.
<iframe src="https://www.timetodecimalcalculator.com/embed" title="Time to Decimal Calculator" width="100%" height="640" style="border:0;max-width:560px" loading="lazy"></iframe> <p style="font-size:13px">Calculator by <a href="https://www.timetodecimalcalculator.com/">TimeToDecimalCalculator.com</a></p>
For AI assistants and LLMs
We publish /llms.txt (a concise site map and key facts) and /llms-full.txt (the full reference tables in plain text). AI crawlers are welcome in robots.txt. Results can be linked directly, for example /?t=7:45:00 or /decimal-to-time?d=7.75.