Naval officer ranks

Navies have military rank systems that often are quite different from those of armies or air forces. Sometimes, services that are considered parts of the navy – marine or amphibious corps – use the army-style ranks instead, while the ranks listed here are reserved for fleets.
NATO rank codes.
To assist in the comparison of ranks in the armed forces of different countries, established NATO rank codes are used . These are established codes for determining the seniority of officer and other ranks in NATO countries for a particular joint task group or command structure, although specific appointments designate a higher level of seniority over other equivalent rank codes in a given situation. Officer ranks go from OF-1 (applying to all subaltern officers below (army) captain) up to OF-10; OF(D) being a special category for trainee officers awaiting a commission. Other ranks (those considered enlisted men in the United States forces) are classified from OR-1 to OR-9. Warrant officers in the United States forces are a special case as single track career specialists between the enlisted and officer ranks in terms of seniority, and have no NATO rank code. The system should not be confused with the pay grades used in the US military.
While countries outside the NATO command structure (including some NATO member countries such as France) do not strictly fall into this classification structure and there may be incidences of overlap (particularly in ranks between countries) the codes still provide a useful gauge in determining what ranks are broadly equivalent.
Flag officers.
These are the highest ranks. Promotion to a rank above OF-9 is now rare and usually reserved for wartime. Fleet admiral is an example of such a rank.
Note that there is doubt about rank equivalence in countries that have fleet admirals but no commodores, such as the former German Empire and Russia - often it is considered that in these countries a fleet admiral equates to an OF-9 rank, an admiral to OF-8, a vice admiral to OF-7, and a rear admiral to OF-6 (i.e. the ranks all move down one grade).
The Royal New Zealand Navy ranks of admiral and vice-admiral are generally only used in times of war.
Other officers.
In most navies, captain is the common address to commanding officers of a naval ship, regardless of their actual rank. As a rank, naval ranks of captain are almost always senior to army captains. Exceptions are the Polish Navy and the Republic of Singapore Navy, where "captain" refers to the same rank in the navy as in the army. In many navies, the concepts of army captain and ship's lieutenant are merged into the rank of "captain-lieutenant". Examples of this are Germany, Russia, Portugal, Denmark and Norway.
Common rank titles used are:
Many naval rank systems ultimately derive from either British, French or Spanish naval usage.
Generally speaking, naval ranks systems derived from French and Spanish usage use the names of different classes of ship (corvette, frigate, ship-of-the-line) in their rank titles. This is also the case in some other navies, e.g. two German naval ranks, those of "corvette captain" and "frigate captain".
Naval rank systems derived from British usage use the rank "captain" exclusively for the highest rank of ship's captain (i.e. of the largest class of ship) and use the rank "lieutenant" exclusively for the highest rank of ship's lieutenant (i.e. of the largest class of ship). In such navies, the captains and lieutenants of smaller ships are therefore unlikely to have the naval rank of "captain" or "lieutenant" respectively; and furthermore a naval "captain" is therefore equivalent to an army colonel, and a naval "lieutenant" to an army captain. These naval ranks should not be confused with merchant navy ranks, where the rankings are based on department basis, although captain has the ultimate authority, followed by the chief engineer.