Everyday math & dates

Military Time Converter

Use the first box to turn a normal clock time into military time, and the second to turn a four-digit military time back into AM or PM.

Standard time to military time

Your result will appear here.

Military time to standard time

Four digits, like 1545 or 0730.

Your result will appear here.

How it's calculated

Military time counts the hours from 00 to 23 and writes them as four digits with no colon. Morning times keep their hour with a leading zero: 7:30 AM is 0730. For afternoon and evening times, add 12 to the hour: 3:45 PM is 1545.

Midnight is 0000 and noon is 1200. To go back, subtract 12 from any hour above 12 and add PM.

How to do it in Excel

Excel stores times as fractions of a day, so the conversion is just a different number format:

=TEXT(A2, "hhmm")
Military time as text from a time in A2.
=TEXT(TIME(LEFT(B2,2), RIGHT(B2,2), 0), "h:mm AM/PM")
Standard time from a four-digit military time typed as text in B2.

Related Excel tutorials