Time Format Converter
Convert between 24-hour and 12-hour time formats instantly
Use our dedicated military time converter for instant conversions:
Military Time ConverterRelated Time Tools
Frequently Asked Questions
Time Converter – 12-Hour vs. 24-Hour Time Formats Explained
Converting between 12-hour (AM/PM) and 24-hour time formats is one of the most common time-related tasks, whether you are reading a European train schedule, interpreting a medical record, setting a digital device, or writing code that handles timestamps. This comprehensive guide explains both formats, shows you when to use each, and provides quick-reference tables and conversion shortcuts.
Understanding the Two Formats
The 12-hour clock divides the 24-hour day into two periods: ante meridiem (AM, meaning “before noon”) and post meridiem (PM, meaning “after noon”). Hours run from 12:00 to 12:59, then 1:00 to 11:59, cycling twice per day. The system originated with ancient Egyptians and Romans, who divided daylight and darkness into twelve parts each.
The 24-hour clock counts hours from 00 (midnight) to 23 (11 PM). There is no AM or PM—every time in the day has a unique numerical representation. This system has been used since the early 19th century and is the international standard (ISO 8601).
Conversion Formulas
12-hour to 24-hour:
- AM times (except 12 AM): Keep the hour, add leading zero if needed. 9:30 AM → 09:30
- 12:00 AM (midnight): Convert to 00:00
- PM times (except 12 PM): Add 12 to the hour. 4:15 PM → 16:15
- 12:00 PM (noon): Keep as 12:00
24-hour to 12-hour:
- Hours 01–11: Same number + AM. 09:30 → 9:30 AM
- Hour 00: Convert to 12 AM. 00:45 → 12:45 AM
- Hour 12: Keep as 12 PM. 12:00 → 12:00 PM
- Hours 13–23: Subtract 12 + PM. 17:00 → 5:00 PM
Which Countries Use Which Format?
The 24-hour clock is the dominant format in the vast majority of countries worldwide. Here is a breakdown by region:
- 12-hour (primary): United States, Canada (English-speaking), Australia, New Zealand, Philippines, India (informal), Pakistan, Bangladesh, Malaysia, Colombia, Honduras, and Egypt
- 24-hour (primary): All of Europe, most of Latin America (Brazil, Argentina, Mexico, Chile), all of East Asia (Japan, China, South Korea), all of Southeast Asia (except Philippines), the Middle East, and all of Africa (except Egypt informally)
- Mixed usage: The UK, Ireland, and Canada use both formats depending on context. Written schedules and timetables use 24-hour time, while casual speech uses 12-hour.
Common Times in Both Formats
| 12-Hour | 24-Hour | Description |
|---|---|---|
| 12:00 AM | 00:00 | Midnight – start of day |
| 1:00 AM | 01:00 | Early morning |
| 6:00 AM | 06:00 | Typical early wake-up |
| 7:30 AM | 07:30 | Common commute start |
| 9:00 AM | 09:00 | Business hours begin |
| 12:00 PM | 12:00 | Noon – lunch time |
| 1:00 PM | 13:00 | Early afternoon |
| 3:30 PM | 15:30 | Mid-afternoon |
| 5:00 PM | 17:00 | Business hours end |
| 6:30 PM | 18:30 | Common dinner time |
| 8:00 PM | 20:00 | Prime-time evening |
| 10:00 PM | 22:00 | Late evening |
| 11:59 PM | 23:59 | Last minute of the day |
Conversion Shortcuts
Mental math for time conversion becomes second nature with a few tricks:
- The “minus 12” rule: For any 24-hour time from 13:00 to 23:59, subtract 12 to get the PM hour. 16:00 − 12 = 4:00 PM.
- The “subtract 2, drop the 1” shortcut: For times 13–21, take the last digit, subtract 2, and that’s your PM hour. 15:00 → 5 − 2 = 3 → 3:00 PM. For 22 and 23, this still works: 22 → 2 − 2 = 0, but you know 22:00 = 10 PM; 23 → 3 − 2 = 1, 23:00 = 11 PM.
- Anchor at 18:00: Most people easily remember that 18:00 = 6:00 PM. Work up or down from there.
Worked Examples
Convert 14:45 to 12-hour: 14 − 12 = 2, so 14:45 = 2:45 PM.
Convert 8:20 PM to 24-hour: 8 + 12 = 20, so 8:20 PM = 20:20.
Convert 12:30 AM to 24-hour: 12 AM is a special case—it becomes 00:30.
Programming with Time Formats
When working with time in code, the 24-hour format is almost always preferred. It simplifies sorting, comparison, and arithmetic. Here are common patterns across languages:
- JavaScript:
toLocaleTimeString('en-US', { hour12: false })outputs 24-hour time. Use{ hour12: true }for 12-hour format. - Python:
datetime.strftime('%H:%M')for 24-hour,'%I:%M %p'for 12-hour. - PHP:
date('H:i')for 24-hour,date('g:i A')for 12-hour. - SQL:
TIME_FORMAT(column, '%H:%i')(MySQL) orFORMAT(column, 'HH:mm')(SQL Server).
Always store times internally in 24-hour format or as Unix timestamps. Convert to 12-hour format only at the display layer for users who prefer it. This avoids AM/PM ambiguity in databases and APIs.
The Noon and Midnight Problem
The 12-hour system creates genuine confusion at noon and midnight. Technically, 12:00 PM is noon and 12:00 AM is midnight, but many people get these backwards. Some style guides recommend using “noon” and “midnight” in plain text to avoid ambiguity. The 24-hour system resolves this completely: 00:00 is always midnight, 12:00 is always noon, and there is no possibility of misinterpretation.
When to Use Each Format
- Use 12-hour for casual communication in the US, Canada, and Australia; for consumer-facing products targeting these markets; and when your audience is unfamiliar with 24-hour time.
- Use 24-hour for international scheduling, professional and technical contexts, medical records, aviation, military operations, software development, and any situation where ambiguity could cause errors.