12-Hour to 24-Hour Time Converter

12-Hour to 24-Hour Time Converter

Leading AI Skill PRO

Enter Calculation

Formula

H24=(Hourmod12)H_{24} = \left(\text{Hour} \bmod 12\right)
Usage stats

Advertisement

Results

24-Hour (Military) Time
09:30
hours
24-hour value 9
Minutes 30
Military (HHMM) 0930

Report an error on this page

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.

Analog 12-hour clock with AM/PM icons linked by an arrow to a 24-hour clock dial
A 12-hour AM/PM time maps to a single 24-hour value.

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).

Advertisement
Conversion chart pairing each 12-hour AM and PM hour with its 24-hour equivalent
Each AM/PM hour aligns to its 24-hour counterpart, with noon and midnight as special cases.

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.

Advertisement

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:

  1. Note the period. Decide whether the time is AM or PM.
  2. AM and the hour is 12: change the hour to 00 (12:30 AM becomes 00:30).
  3. AM and the hour is 1-11: keep the hour as it is (7:15 AM becomes 07:15).
  4. PM and the hour is 12: keep 12 (12:45 PM becomes 12:45).
  5. PM and the hour is 1-11: add 12 to the hour (4:20 PM becomes 16:20).
  6. 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."

Last updated:

Most popular in Time and Date

View all Time and Date calculators