# How to convert time to decimal?

Converts hours, minutes, and seconds to decimal hours (7:45 is 7.75 hours), and decimal hours back to hours, minutes, and seconds.

- Page: https://www.acalculator.org/days/time-to-decimal-calculator
- JSON spec: https://www.acalculator.org/days/time-to-decimal-calculator.json
- Version: 887b9a7ffdd6

## Default answer

Example with the default inputs (Convert Time to decimal, Hours 7, Minutes 45, Seconds 0): 7:45:00 is 7.75 hours.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| mode | Convert | Convert a time to decimal hours, or decimal hours to a time. |
| h | Hours | Whole hours of the time. |
| m | Minutes | Whole minutes of the time. 60 or more is fine. |
| s | Seconds | Whole seconds of the time. 60 or more is fine. |
| dec | Decimal hours | A time in hours with a decimal point, such as 7.75. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| time | Time | Converting decimal hours: the time in whole hours, whole minutes, and seconds. |
| hours | Decimal hours | The time in hours: hours + minutes ÷ 60 + seconds ÷ 3,600. |
| clock | As h:mm:ss | The time written as hours:minutes:seconds, with minutes and seconds under 60. |
| minutes | Decimal minutes | The time in minutes: hours × 60 + minutes + seconds ÷ 60. |
| seconds | Seconds | The time in seconds: hours × 3,600 + minutes × 60 + seconds. |

## Method

decimal hours = hours + minutes ÷ 60 + seconds ÷ 3,600; back: seconds = decimal hours × 3,600, split into hours, minutes, and seconds

## Assumptions

- An hour is 60 minutes and a minute is 60 seconds.
- Converting a time, the hours, minutes, and seconds are whole numbers; minutes and seconds may be 60 or more.
- Converting decimal hours, the time is rounded half up to the nearest millisecond.

## Worked examples

1. mode = toDecimal, h = 7, m = 45, s = 0 gives hours = 7.75, clock = 7:45:00, minutes = 465, seconds = 27,900. Source: SI Brochure (BIPM, 9th edition, 2019), Table 8: 1 h = 60 min = 3,600 s.
2. mode = toDecimal, h = 1, m = 20, s = 15 gives hours = 1.3375, clock = 1:20:15, minutes = 80.25, seconds = 4,815. Source: SI Brochure (BIPM, 9th edition, 2019), Table 8.
3. mode = toDecimal, h = 0, m = 90, s = 0 gives hours = 1.5, clock = 1:30:00.
4. mode = toTime, dec = 1.2345 gives time = {"hours":1,"minutes":14,"seconds":4.2}, clock = 1:14:04.2, minutes = 74.07, seconds = 4,444.2. Source: SI Brochure (BIPM, 9th edition, 2019), Table 8.
5. mode = toTime, dec = 0.3 gives time = {"hours":0,"minutes":18,"seconds":0}, clock = 0:18:00, seconds = 1,080.

## FAQ

### How do I convert time to decimal hours?

Divide the minutes by 60 and the seconds by 3,600, and add them to the hours. 7 hours 45 minutes is 7 + 45 ÷ 60 = 7.75 hours.

### How do I convert decimal hours back to hours and minutes?

Keep the whole hours and multiply the decimal part by 60 for minutes. 7.75 hours is 7 hours and 0.75 × 60 = 45 minutes. If the minutes have a decimal part, multiply that by 60 for seconds.

### Why do timesheets use decimal hours?

Pay is hours × hourly rate, and that needs hours as one number. 7 hours 45 minutes at $20 an hour is 7.75 × 20 = $155, not 7.45 × 20.

### What are common minutes in decimal hours?

15 minutes is 0.25 hours, 30 minutes is 0.5, 45 minutes is 0.75, 20 minutes is 0.3333, 10 minutes is 0.1667, 6 minutes is 0.1, and 1 minute is 0.0167 hours to 4 decimal places.

### Can I enter 90 minutes?

Yes. Minutes and seconds may be 60 or more. 0 hours and 90 minutes is 1.5 hours, shown as 1:30:00.

### How precise is the result?

Decimal hours and decimal minutes show to 4 decimal places, rounded half up. A time from decimal hours is rounded half up to the nearest millisecond.

## Sources

- Bureau International des Poids et Mesures, The International System of Units (SI Brochure, 9th edition, 2019), Table 8: 1 min = 60 s, 1 h = 60 min = 3,600 s.
