In NATO countries, the rank of captain is described by the code OF-2 and is one rank above an OF-1 (lieutenant or first lieutenant) and one below an OF-3 (major or commandant). The rank of captain is generally considered to be the highest rank a soldier can achieve while remaining in the field.

In some militaries, such as United States Army and Air Force and the British Army, captain is the entry-level rank for officer candidates possessing a professional degree, namely medical professionals (doctors, nurses, pharmacists, dentists) and lawyers. (In the United States Army, lawyers who are not already officers at captain rank or above enter as lieutenants during training, and are promoted to the rank of captain after completion of their training if they are in the active component, or after a certain amount of time, usually one year from their date of commission as a lieutenant, for the reserve components.)

The military rank of captain was in use from the 1560s, referring to an officer who commands a company. The naval sense, an officer who commands a man-of-war, is somewhat earlier, from the 1550s, later extended in meaning to "master or commander of any kind of vessel". A captain in the period prior to the professionalization of the armed services of European nations subsequent to the French Revolution, during the early modern period, was a nobleman who purchased the right to head a company from the previous holder of that right. He would in turn receive money from another nobleman to serve as his lieutenant. The funding to provide for the troops came from the monarch or his government; the captain had to be responsible for it. If he was not, or was otherwise court-martialed, he would be dismissed ("cashiered"), and the monarch would receive money from another nobleman to command the company. Otherwise, the only pension for the captain was selling the right to another nobleman when he was ready to retire.

In most countries, the air force is the junior service and so air force ranks have been adopted or modified from one of the other services. Many, such as the United States Air Force, use a rank structure and insignia similar to those of the army.

In the unified system of the Canadian Forces, the air force rank titles are identical to that of the army as are army and air rank insignia, with both wearing two gold stripes on the sleeve or epaulette. While the rank is equivalent to a naval lieutenant, naval lieutenant rank insignia is embellished with the executive curl. The modern equivalent of the British group captain bears the rank and insignia of colonel, i.e. four gold stripes on sleeve or epaulette (same as a naval captain).

^The U.S. Marine Corps insignia for captain is slightly different from the USA / USAF insignia depicted above in that it lacks beveled edges and the cross-bars are further towards the ends. See collar insignia for U.S. Navy lieutenant.