Military time converter
3:45 PM is 1545 in military time, and 12:01 AM is 0001. Enter the hour, minutes and AM or PM from a schedule and get the four-digit reading that duty rosters, hospital charts and radio logs require, plus a version with a colon. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Hour
- 3
- Minute
- 45
- Period
- PM
- Twelve hour
- 3:45 PM
- Military hour
- 15
- Military minute
- 45
- Military time
- 1545
A military-time converter takes a civil twelve-hour clock reading with an AM or PM marker and returns the matching twenty-four-hour string used on duty rosters, flight strips, hospital charts, and radio logs. People land here when a schedule says three forty-five in the afternoon and a form, protocol, or logbook demands 1545 with no colon and no meridiem. Enter the hour from one through twelve, the minutes from zero through fifty-nine, and the period AM or PM. The calculator applies the two midnight-and-noon exceptions—twelve AM becomes 0000, twelve PM stays 1200—and otherwise adds twelve hours for any PM hour that is not twelve.
How 12-hour AM/PM becomes 24-hour military time
On a twelve-hour clock the hour hand cycles twice a day, so the numeral twelve is overloaded: it is midnight when paired with AM and noon when paired with PM. Military time, also called twenty-four-hour time in ISO 8601 civil usage, removes that ambiguity by numbering hours from 00 at midnight through 23 in the last hour of the day. Conversion is a small, exact map rather than a lookup table.
If the period is AM and the hour is 12, the military hour is 00. If the period is AM and the hour is 1 through 11, the military hour is that same number, zero-padded to two digits. If the period is PM and the hour is 12, the military hour stays 12.
If the period is PM and the hour is 1 through 11, add twelve: 1 PM is 13, 3 PM is 15, 11 PM is 23. Minutes copy through unchanged, so 3:45 PM is 1545 and 12:01 AM is 0001. The four-digit string is the usual military written form; a colonated HH:MM twin is useful for logs that still want a separator.
This converter never consults a timezone, a calendar, or the computer clock: it maps one time of day onto another. It also never wraps hour 13 into 1, because a twelve-hour input that already left the 1–12 range is invalid rather than a clock face to spin. Seconds, milliseconds, and offsets belong to timestamp tools, not this landing.
The spoken readback “fifteen forty-five hours” is the same instant as 1545, which is why dispatch desks prefer digits that cannot be heard as morning or evening.
Where military time conversion earns its keep
Hospitals, firehouses, dispatch desks, and military units write times as four digits so a radio readback cannot confuse 8:00 AM with 8:00 PM. Airlines and air-traffic strips use twenty-four-hour clocks for the same reason. Students meeting a style guide that demands 24-hour time, travelers reading a European timetable, and developers filling ISO-like local-time fields all need the same map.
Typical searches include military time converter, convert to military time, 12 hour to 24 hour, and what is 3:45 PM in military time. Sanity checks are cheap: 12:00 AM must be 0000, 12:00 PM must be 1200, 1:00 AM must be 0100, 1:00 PM must be 1300, 11:59 PM must be 2359. If you instead need to add hours across midnight, convert time zones, or turn a Unix timestamp into a wall clock, those are different landings: adding hours, timezone conversion, and epoch tools.
A duration converter that turns hours into minutes is also a different search. Stay inside the hour and minute ranges so a typo cannot silently become another valid clock. Failed validation does not consume balance.
Pin the four-digit string in tests and you get a deterministic oracle for duty-roster generators, LMS quizzes, and form validators without standing up a datetime library that would also drag in locales and daylight-saving tables you do not want on a clock-of-day conversion.
What you can do with it
Duty rosters and radio logs
Turn a civil 12-hour posting such as 3:45 PM into the four-digit 1545 used on watch bills, after-action reports, and voice readbacks that must not confuse morning with evening.
Healthcare charts and dispatch
Stamp medication rounds, incident times, and ambulance logs in 24-hour military time so a 12 AM midnight dose is 0000 and cannot be filed next to noon.
Travel timetables and homework
Convert AM/PM clock times from a US itinerary or worksheet into 24-hour military time for European boards, style-guide submissions, and automated quiz keys.
FAQ
How do I convert 12-hour AM/PM time to military time?
Send hour (1–12), minute (0–59), and period AM or PM.
What is 12:00 AM in military time?
Twelve AM is midnight, so the converter returns 0000. Twelve PM is noon and returns 1200. Those two exceptions are the whole reason the numeral 12 is special.
What is 12:00 PM in military time?
Twelve PM maps to 1200 (noon). Afternoon hours 1 PM through 11 PM add twelve, so 1:00 PM is 1300 and 11:59 PM is 2359.
What happens if the hour is 13 or minutes are 60?
Hour must be 1 through 12 on a 12-hour clock; minutes must not exceed 59. Invalid input is not billed.
Does military time use a colon?
Usually not: the written form is four digits, such as 1545. The converter also gives the same time with a colon, 15:45, for logs that still want a separator.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/conv/military-time \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"hour":3,"minute":45,"period":"PM"}'const res = await fetch("https://api.kit.forhosting.com/conv/military-time", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"hour": 3,
"minute": 45,
"period": "PM"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/conv/military-time",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"hour": 3,
"minute": 45,
"period": "PM"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/conv/military-time", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"hour":3,"minute":45,"period":"PM"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"hour":3,"minute":45,"period":"PM"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/conv/military-time", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"hour": 3,
"minute": 45,
"period": "PM"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "conv.military_time",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Hours outside one through twelve and minutes above fifty-nine fail with invalid_input instead of wrapping like a toy clock.
Input contract, response shape, and error behaviour
Numeric strings that parse as whole integers are accepted; fractional hours, booleans, empty strings, and non-finite values fail. Example: hour 12, minute 0, period AM yields 0000, the midnight reading. Do not send a 24-hour string such as 15:45 and expect a round trip; this landing is one direction, twelve-hour with AM or PM in and military time out. POST a JSON body with three required fields. hour is an integer from 1 through 12. minute is an integer from 0 through 59. period is the closed set AM or PM; aliases ampm, meridiem, and am_pm are accepted so forms and SDKs can use the name that fits the product. On success the body echoes hour, minute, and period in canonical uppercase form, sets military_hour to 0 through 23 and military_minute to the same minute, and returns military_time as the four-digit HHMM string that searchers mean by military time. military_colon is the same reading with a colon, twelve_hour restates the civil input, formula names the branch that fired, message is a short English summary, and steps lists the substitution lines. Example: hour 3, minute 45, period PM yields military_time 1545 because three plus twelve is fifteen. If hour is outside 1–12 the task fails with invalid_input naming that field; if minutes exceed 59 the same code fires for minute. Missing period is likewise invalid_input. Those failures are not billed. Pricing for a successful call is the published $0.002 base with unit item.
Technical questions
What does the military time converter cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.