What is a 12-Hour to 24-Hour Time Converter?
This tool converts the everyday 12-hour clock — the AM/PM system used in the United States, the United Kingdom and many other English-speaking countries — into 24-hour "military" time. In the 24-hour system there is no AM or PM: the day runs continuously from 00:00 (midnight) to 23:59 (one minute before the next midnight). This format is standard in aviation, the military, healthcare, computing and most of the world's railway and broadcast schedules.
How to Use It
Enter the hour (1–12), the minute (0–59), and select AM or PM. The converter returns the exact 24-hour equivalent, formatted as HH:MM, along with the numeric hour and a four-digit military value such as 1330.
The Formula Explained
The conversion uses one simple rule:
$$H_{24} = (h \bmod 12) + 12 \cdot [\text{PM}]$$For PM times, take the hour modulo 12 and add 12: 1 PM → \((1 \bmod 12) + 12 = 13\). For AM times, take the hour modulo 12 with no addition: this turns 12 AM into 0, which is written as 00:00. Note the two special cases — 12 AM is midnight (00:00) and 12 PM is noon (12:00).
Worked Example
Convert 9:30 AM. The hour is 9 and the period is AM, so
$$H_{24} = 9 \bmod 12 = 9$$The result is 09:30, with a military value of 0930. Now convert 9:30 PM:
$$H_{24} = (9 \bmod 12) + 12 = 21$$giving 21:30 or 2130 hours.
How to Convert 12-Hour Time to 24-Hour Time by Hand
The 24-hour clock (often called military time in the US) numbers the hours 00 to 23. Converting from AM/PM only changes the hour; the minutes stay the same. Follow these steps:
- Note the period. Decide whether the time is AM or PM.
- AM and the hour is 12: change the hour to 00 (12:30 AM becomes 00:30).
- AM and the hour is 1-11: keep the hour as it is (7:15 AM becomes 07:15).
- PM and the hour is 12: keep 12 (12:45 PM becomes 12:45).
- PM and the hour is 1-11: add 12 to the hour (4:20 PM becomes 16:20).
- Keep the minutes unchanged and pad the hour to two digits. Write a leading zero for any hour below 10 (for example 09:05).
In formula form, with the hour written as \(h\) (1 to 12):
$$H_{24} = (h \bmod 12) + \begin{cases} 0 & \text{if AM} \\ 12 & \text{if PM} \end{cases}$$
Worked example: convert 3:45 PM. The period is PM and the hour is 3, so \(H_{24} = (3 \bmod 12) + 12 = 3 + 12 = 15\). The minutes stay 45, so the result is 15:45.
Another example: 12:10 AM. The period is AM and the hour is 12, so \(H_{24} = (12 \bmod 12) + 0 = 0\). The result is 00:10.
Quick reverse check
To go back from 24-hour to 12-hour time, subtract 12 from any hour above 12 to get the PM hour. For example, 15:45 gives \(15 - 12 = 3\), so 3:45 PM. If the check does not return your original time, recheck the AM/PM period. Hours 01-11 are AM, 12 is 12 PM, 13-23 are PM, and 00 is 12 AM.
FAQ
What is 12 AM in 24-hour time? 12 AM is midnight, written as 00:00. Twelve modulo 12 equals 0.
What is 12 PM in 24-hour time? 12 PM is noon, written as 12:00, because \((12 \bmod 12) + 12 = 12\).
Is "military time" the same as 24-hour time? Yes — the format is identical. Military usage typically drops the colon (e.g. 1330) and reads it as "thirteen thirty hours."