12-Hour and 24-Hour Time Converter

Convert times between 12-hour AM/PM and 24-hour military format

Convert clock times between 12-hour AM/PM and 24-hour formats in either direction. Handles the midnight and noon edge cases correctly, accepts times with or without a colon, and validates your input. Runs in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How is midnight handled?

12:00 AM is midnight and converts to 00:00 in 24-hour format. In the other direction, 00:00 through 00:59 convert to 12:00 AM through 12:59 AM, since the hour zero is the 12 oclock hour after midnight.

This converter switches clock times between the 12-hour AM/PM format common in the United States and the 24-hour format used in most of the world and in any context where ambiguity is unacceptable. It works in both directions and gets the tricky midnight and noon cases right.

How it works

Converting from 12-hour to 24-hour applies two rules to the hour, leaving the minutes untouched:

if period is AM and hour == 12  ->  hour = 0
if period is PM and hour != 12  ->  hour = hour + 12

Converting from 24-hour back to 12-hour reverses this: the period is AM when the hour is below 12 and PM otherwise, and the displayed hour is hour mod 12, shown as 12 when that result is zero. The minute field is always two digits.

Example and tips

2:34 PM becomes 14:34, while 00:15 becomes 12:15 AM. The two cases worth memorising are the boundaries: midnight is 12:00 AM equal to 00:00, and noon is 12:00 PM equal to 12:00. If you are storing times in software, prefer the 24-hour form because it sorts correctly as text and avoids the AM/PM ambiguity entirely.

Why midnight and noon are where people go wrong

The 12-hour clock has a counterintuitive quirk: the hour labelled “12” is actually the first hour of each half-day, not the thirteenth. This means:

  • 12:00 AM is midnight — the start of the day, equivalent to 00:00 in 24-hour notation
  • 12:01 AM is one minute after midnight — 00:01
  • 12:00 PM is noon — the middle of the day, equivalent to 12:00 in 24-hour notation
  • 12:01 PM is one minute after noon — 12:01

The consequence is that “12 PM” and “12:00 midnight” trip up most people who have not specifically thought about it. A meeting scheduled for 12:00 AM is at midnight, not at lunchtime. This is the source of the common misreading.

The 24-hour clock eliminates the confusion entirely. Hour 00 is midnight, hour 12 is noon, and the numbering runs continuously from 00:00 to 23:59. There is no AM or PM and no ambiguous 12.

Where 24-hour time is standard

Outside the United States, 24-hour notation is the norm in everyday use across much of Europe, Latin America, Asia, Africa, and Oceania. It is required in aviation (where a miscommunicated departure time could be catastrophic), emergency services, the military, scientific notation, and most computing contexts. ISO 8601 — the international date and time standard — specifies 24-hour format as the canonical representation.

In the United States, 12-hour AM/PM notation is dominant in everyday civilian use but 24-hour time is used in the military (“zero eight hundred hours”), in healthcare settings, in public transit schedules, and increasingly in software interfaces.

When to use each format

Use 12-hour AM/PM when writing for a general American audience in casual contexts — event invitations, informal messages, consumer interfaces. Use 24-hour when writing for international audiences, in technical contexts, in any software that stores or displays times as strings (where 24-hour sorts and compares correctly as text without special handling), in healthcare or emergency settings, and anywhere that midnight/noon confusion would be significant.

If you are storing times in a database or passing them between systems, 24-hour format in ISO 8601 notation — for example 14:30:00 or the full 2026-06-06T14:30:00Z — is the right choice regardless of what format you display to users. Display format is a presentation concern; storage format should always be unambiguous.