Understand 24-hour and 12-hour clock notation

How 24-hour and 12-hour time formats differ, how to convert between them correctly, and when a converted time stays clear after copying or sharing.

Is converting to 24-hour time right for your use?

Converting a time from 12-hour to 24-hour notation is usually a safe, meaning-preserving change, provided midnight and noon are handled correctly. The main benefit is that every hour of the day gets a distinct number, so no AM or PM marker is needed to tell morning from evening. The tradeoff is familiarity. In the US, most everyday readers expect 12-hour times, and some will slow down or misread a value such as 17:30. The 24-hour format suits schedules, logs, shift rosters, medical and technical records, and international audiences. Plain 12-hour text is the better choice for casual US-facing messages, signage and marketing copy, where the reader's comfort matters more than removing ambiguity.

What the conversion actually changes

This transformation changes the stored characters. It is not a visual effect. Converting "3:45 PM" to "15:45" replaces the hour digits and removes the period marker, and anyone who copies the result gets the new characters. It involves no character reversal, mirrored glyphs, decorative Unicode fonts or CSS styling. Both formats use ordinary digits and a colon, so the output does not depend on special characters to display correctly.

The 24-hour clock counts hours from 00 to 23, starting at midnight. Hours are usually written with two digits, so 9 in the morning becomes 09:00. The 12-hour clock counts from 1 to 12 twice a day and needs AM (before noon) or PM (after noon) to be unambiguous. Under the common convention, midnight is 12:00 AM and noon is 12:00 PM.

The 24 hours of the day in both formats

24-hour | 12-hour
00:00 | 12:00 AM (midnight)
01:00 | 1:00 AM
02:00 | 2:00 AM
03:00 | 3:00 AM
04:00 | 4:00 AM
05:00 | 5:00 AM
06:00 | 6:00 AM
07:00 | 7:00 AM
08:00 | 8:00 AM
09:00 | 9:00 AM
10:00 | 10:00 AM
11:00 | 11:00 AM
12:00 | 12:00 PM (noon)
13:00 | 1:00 PM
14:00 | 2:00 PM
15:00 | 3:00 PM
16:00 | 4:00 PM
17:00 | 5:00 PM
18:00 | 6:00 PM
19:00 | 7:00 PM
20:00 | 8:00 PM
21:00 | 9:00 PM
22:00 | 10:00 PM
23:00 | 11:00 PM

The rule behind the table: for PM hours from 1 to 11, add 12. For 12 AM, use 00. For 12 PM, keep 12. AM hours from 1 to 11 stay the same and gain a leading zero if needed. Converting back works the same way in reverse. Subtract 12 from hours 13 to 23 and mark them PM, turn 00 into 12 AM, and mark 12 as PM.

Edge cases that break naive conversions

  • 12:30 PM converts to 12:30, not 24:30. A tool that blindly adds 12 to every PM hour produces an invalid time.
  • 12:05 AM converts to 00:05. Leaving it as 12:05 shifts the time by twelve hours.
  • Some schedules and standards write 24:00 to mark the end of a day, which differs from 00:00 at the start of the next day. A converter may reject 24:00 or map it to midnight without saying which day is meant.
  • Military-style notation often drops the colon (1545). Text that mixes styles can confuse parsers that expect one form.
  • AM and PM appear in many spellings, including am, a.m., A.M. and a single A or P. Check that a tool recognizes the variants in your source text.
  • Times with seconds (15:45:30) need the seconds carried through unchanged.

To check a tool's output, run a small set of test inputs that cover these cases: an ordinary afternoon time, 12:00 PM, 12:00 AM, a time just after midnight, and one with seconds. The correct results are 3:45 PM to 15:45, 12:00 PM to 12:00, 12:00 AM to 00:00, 12:05 AM to 00:05, and 11:59:30 PM to 23:59:30.

def to_24h(hour12, minute, period):
    period = period.upper()
    if period == "AM":
        hour = 0 if hour12 == 12 else hour12
    else:
        hour = 12 if hour12 == 12 else hour12 + 12
    return f"{hour:02d}:{minute:02d}"

# to_24h(3, 45, "PM")  -> "15:45"
# to_24h(12, 0, "AM")  -> "00:00"
# to_24h(12, 30, "PM") -> "12:30"

Will the result stay readable after copying or sharing?

Because the output is ordinary digits and a colon, it generally copies and pastes cleanly into documents, messages and forms. The bigger risk is interpretation. A reader unfamiliar with 24-hour time may misread 19:00, and a reader of 12-hour text may miss a dropped or mistyped AM or PM.

Watch for invisible characters. Time strings produced by locale-aware formatting libraries, including those built on the Unicode CLDR data, may put a narrow no-break space (U+202F) between the time and AM or PM instead of a regular space. The text looks normal, but find-and-replace, search and some date parsers that expect an ordinary space may fail to match it. If a pasted 12-hour time behaves oddly, retype the space or inspect the characters.

Static text does not adapt to the reader. A time rendered by an app or operating system can follow each viewer's clock preference, but a converted time pasted into a message stays in whatever format it was written in. Spreadsheets and calendar tools may also treat a pasted time as a time value and redisplay it in the local format, so the stored text and the displayed text can differ. Check the destination before relying on the exact format.

Screen readers and text-to-speech engines may read 24-hour times in different ways, for example as a spoken hour and minute or digit by digit with the colon announced. No assistive-technology testing was supplied for this article, so how a given screen reader handles a given format is unverified. For important instructions, test with the screen reader your audience uses, or write ambiguous moments in words, such as "midnight at the start of Saturday."

Search behaves similarly. A page that only says 15:00 may not match a search for "3 PM," and the reverse also holds. Where findability matters, include both forms.

Neither format carries a time zone. Converting between them does not resolve which zone a time refers to, so add the zone separately when readers are spread across regions.

When to keep plain 12-hour text or show both

  • Keep 12-hour text for general US audiences in casual or promotional content, where the format readers expect improves comprehension.
  • Use 24-hour text for logs, data exports, rosters, travel and technical schedules, and audiences used to it.
  • Show both, for example "15:00 (3:00 PM)," when the audience is mixed or a misread time would have real consequences.
  • Spell out midnight and noon in words when a date boundary matters, since 12:00 AM is easily misread in either direction.

Evidence gaps

This article relies on general, verifiable conventions for clock notation. No specific converter, destination platform, spreadsheet application or screen reader was tested, and no measurements were supplied. Treat any claim about how a named tool handles these formats as unconfirmed until you check it with the inputs listed above.