Military Time Calculator — 12-Hour and 24-Hour
Convert a clock time between 12-hour AM/PM notation and four-digit 24-hour military time, with midnight and noon handled explicitly.
Military Time Calculator
Background.
Military time is a compact way to write a time of day on a 24-hour clock. Instead of repeating the hours 1 through 12 twice and adding AM or PM, it numbers the day from hour 00 through hour 23. Minutes retain their familiar range from 00 through 59. A four-digit group such as 1905 therefore means hour 19, minute 05: 7:05 PM on a 12-hour clock.
This calculator converts in both directions. In 12-to-24 mode, enter an hour from 1 to 12, a minute, and AM or PM. In 24-to-12 mode, enter an hour from 0 to 23 and a minute; the AM/PM selector is ignored for the calculation but remains validated. The result shows both notations together so the conversion can be checked rather than trusted as a single unexplained number.
Midnight and noon cause most errors. Twelve midnight is the beginning of the civil day and becomes 0000. Twelve noon remains 1200. For every other PM time, add 12 to the hour: 1:00 PM becomes 1300 and 11:59 PM becomes 2359. For morning times from 1:00 through 11:59, retain the hour and add a leading zero when needed: 6:30 AM becomes 0630.
Converting back follows the opposite pattern. Hours 00 through 11 are AM; hours 12 through 23 are PM. An hour of 00 displays as 12 AM, while 12 displays as 12 PM. For 13 through 23, subtract twelve to obtain the familiar afternoon or evening hour. Minutes never change in either direction.
The four-digit output contains no colon because that is the compact notation people usually mean by “military time.” The accompanying 12-hour output includes a colon and period label. Formal systems vary: some write 19:05, some write 1905, and aviation or military messages may append a zone designator such as Z for UTC. A bare four-digit time does not identify a time zone, so this page never invents one.
The calculator treats times as points within one ordinary civil day. It accepts 0000 through 2359 and deliberately rejects 2400. Certain operational schedules allow 2400 to mean the end of a specifically named date, but without a date that notation is ambiguous with 0000 of the next day. RFC 3339 similarly uses hour values 00 through 23.
This conversion does not calculate elapsed time. If a shift starts at 2300 and ends at 0700, converting the labels will not tell you the eight-hour duration or decide which date the second time belongs to. Use the live hours-between-times or time-duration calculator for intervals. Likewise, use the time-zone calculator when changing locations or UTC offsets.
Every hour and minute must be a whole number. Fractional hours, negative fields, minute 60, and out-of-range hours are rejected with a field-specific error. Numeric work uses Decimal.js and the minute index is hour multiplied by sixty plus minute. Outputs are rounded once at the required boundary, although valid integer inputs make every numeric result exact.
The word “military” describes the notation here, not an assertion that a time is local military time or UTC. Operational documents govern their own date-time group syntax. This tool is for reading and writing the clock portion accurately.
What is military time calculator?
Military time is common shorthand for the 24-hour clock written as a four-digit hour-and-minute group. The day begins at 0000, noon is 1200, and the last minute is 2359. Unlike a 12-hour clock, the notation needs no AM or PM marker, but it also carries no time-zone information unless a separate zone designator is supplied.
How to use this calculator.
- Choose the direction of conversion.
- Enter the hour and minute as whole numbers.
- When starting from 12-hour time, select AM or PM and use an hour from 1 through 12.
- Read the zero-padded four-digit result or the matching AM/PM result.
- Use a time-zone or duration calculator if the question involves locations, dates, or elapsed hours.
The formula.
Modulo twelve converts the exceptional hour 12 to zero. In AM, no offset is added, so 12:00 AM becomes 00:00. In PM, twelve is added, so 12:00 PM becomes hour 12 while 7:05 PM becomes hour 19. In reverse, hour24 modulo twelve supplies the displayed hour, with a zero remainder replaced by 12. Hours below 12 receive AM and hours 12 or higher receive PM.
For 7:05 PM, 7 mod 12 plus 12 equals 19. Padding produces 1905, and 19 × 60 + 5 equals 1,145 minutes after midnight. Decimal.js performs the arithmetic and numeric outputs cross the boundary through ten-decimal rounding once.
A worked example.
Convert 7:05 PM. The hour is not 12, so add twelve: 7 + 12 = 19. Keep minute 05 and pad both fields to two digits, giving military time 1905. It is 1,145 minutes after midnight, and converting the result back returns 7:05 PM.
Frequently asked questions.
What is 7:05 PM in military time?
Is midnight 0000 or 2400?
What is noon in military time?
Do I add twelve for every PM time?
How do I convert 2300 to regular time?
Does military time always mean UTC?
Why are leading zeros used?
Can this calculate hours between two military times?
References& sources.
- [1]NIST Times of Day FAQs explains the ambiguity of 12 a.m./p.m. and clearer midnight/noon notation.
- [2]IETF RFC 3339 section 5.6 defines hour 00–23 and minute 00–59 in an interoperable time grammar.
- [3]BIPM SI Brochure documents accepted time-of-day notation and distinguishes it from duration.
- [4]FAA Aeronautical Information Manual illustrates four-digit time groups with explicit UTC context.
- [5]U.S. Government Publishing Office Style Manual provides an independent federal time-notation style reference.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 977 calculators remain free
- No billing is enabled