12/24-hour clock converter
Convert between the 12-hour and 24-hour clock in both directions: 1:05 pm → 13:05 and 13:05 → 1:05 PM, with a.m./p.m. spellings, colon-free input, batch conversion and padding or letter-case options.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Lines with an AM/PM marker (including a.m./p.m.) become 24-hour clock; the rest become 12-hour clock. Colon-free forms work too (1305 = 13:05, 105 pm = 1:05 PM) and seconds are optional. Unrecognized lines are reported individually.
Converted result
In 12-hour input the hour must be 1-12; in 24-hour input it must be 0-23. 12:00 AM = 00:00 and 12:00 PM = 12:00.
Enter a time to see the result
Characters: 0 · Output lines: 0 · Converted: 0 · Errors: 0
What this tool does
- Turn AM/PM times into the 24-hour clock for sorting, storage or comparison (1:05 pm → 13:05).
- Rewrite 24-hour shift tables or log times into 12-hour form for people to read (13:05 → 1:05 PM).
- Process a mixed batch: the direction is chosen per line based on whether an AM/PM marker is present.
Example
Input
1:05 pm
Output
13:05
Lines with an AM/PM marker become 24-hour clock; the rest become 12-hour clock. 12:00 AM = 00:00 and 12:00 PM = 12:00.
Frequently asked questions
What are 12:00 AM and 12:00 PM in 24-hour time?
12:00 AM = 00:00 (midnight) and 12:00 PM = 12:00 (noon). Going the other way, 00:00 → 12:00 AM, 12:00 → 12:00 PM and 23:59 → 11:59 PM, which is the usual 12-hour clock convention.
Which values are rejected?
On the 12-hour side the hour must be 1-12, so `00:00 AM` and `13:05 PM` are reported as unrecognized. On the 24-hour side the hour must be 0-23, so `24:00` and `25:00` fail, as do minutes or seconds above 59 (`12:60`).
Is colon-free input supported?
Yes. Three digits are read as hour+minute and four digits as two-digit hour and minute: `130` = 1:30, `1305` = 13:05, `105 pm` = 1:05 PM. One or two digits mean a whole hour (`7` = 07:00, `7 pm` = 19:00).
Can padding and the AM/PM spelling be changed?
Yes. The default is automatic: padded in 24-hour mode (00:00, 13:05) and unpadded in 12-hour mode (1:05 PM). You can force always or never padded, and the marker can be AM/PM, am/pm or a.m./p.m. Seconds default to "only if the input had them", with always or never available too.
Which timezone is used?
None: this tool only changes how the clock is written, never the value, and it does not read the system clock. For timezone offsets such as +08:00 use the time formatter or the date & time converter.
Keywords:12 to 24 hour24 to 12 hour clocktime12to24