Master's mate is an obsolete rating which was used by the Royal Navy, United States Navy and merchant services in both countries for a senior petty officer who assisted the master. Master's mates evolved into the modern rank of Sub-Lieutenant in the Royal Navy, while in the merchant service they evolved into the numbered mates or officers.
Originally, a master's mate was an experienced petty officer who assisted the master but was not in line for promotion to lieutenant. By the mid-eighteenth century, he was far more likely to be a superior midshipman, still waiting to pass his examination for lieutenant or to receive his commission, but taking rather more responsibility aboard ship. Six master's mates were allowed on a first rate, three on a third rate, and two on most frigates.
Master's mates were experienced seamen, and were usually selected from the ranks of the quartermasters, who they supervised, or from the ranks of midshipmen who wanted more responsibility aboard ship; they were less commonly selected from other mates of warrant officers and able seamen. Master's mates were allowed to command vessels, walk the quarterdeck, and mess in the gunroom with the other warrant officers.
Master's mates were responsible for fitting out the ship, and making sure they had all the sailing supplies necessary for the voyage. They hoisted and lowered the anchor, and docked and undocked the ship. They would examine the ship daily, notifying the master if there were problems with the sails, masts, ropes, or pulleys. They executed the orders of the master, and would command in his place if he was sick or absent.
Normally master's mates worked on a three-watch system, with the lieutenants, so that one served as the deputy to the lieutenant on each watch. Master's mates generally assisted the master in navigating the ship and directly supervised the quartermasters in steering the ship. The master's mate with the highest seniority was appointed the head of the midshipman's berth and was responsible for teaching mathematics, navigation, and sailing lore. Master's mates had to keep detailed logs similar to midshipmen. They were also responsible for the division of the crew that included the petty officers.
Second master was a rating introduced in 1753 that indicated a deputy master on 3rd rate ships of the line or larger. Master's mates also acted as Second Master of vessels too small to be allocated a warranted Master. They were paid significantly more than master's mates, £5 5s per month. A second master was generally a master's mate who had passed his examination for master and was deemed worthy of being master of a vessel. Second masters were given the first opportunity for master vacancies as they occurred.
Passed midshipmen awaiting promotion often elected to become master's mates. Though formally the rating did not lead to promotion to lieutenant, master's mates were paid more than any other rating and were the only ratings allowed to command any sort of vessel. A midshipman who became master's mate earned an increase in pay from £1 13s 6p to £3 16s per month, but initially reduced his chances at a commission. Over time, however, an appointment of master's mate became considered a normal part of the path to a commission; the situation caused some confusion during the last part of the 18th century, when two parallel roles - master's mates trying to become masters, and former midshipmen working toward a commission - held the same title and responsibilities aboard ship.
By the first years of the nineteenth century, the prefix "master's" was dropped for passed midshipman, to distinguish them from master's mates in the navigator's branch. In 1824 two further grades were also introduced, consisting of master's assistants and second-class volunteers. These corresponded to midshipmen and first-class volunteers respectively in the executive line. From this point, passed midshipmen had the rating master's mate, abbreviated as mate, and prospective masters had the rating master's assistant. These changes helped eliminate the confusion caused by the mingling of midshipmen in the navigator's branch. In 1838 a Royal Commission, presided over by the Duke of Wellington, recommended the institution of the rank of mate as an official step between midshipman and lieutenant.
By 1840 there were two completely separate "ladders" for promotion:
|Executive Branch||Master's (Navigation) Branch|
|First Class Volunteer||Second Class Volunteer|
In 1861 mate was abolished in favor of sub-lieutenant. This made no practical difference to the officers in question since they continued to receive the same pay as before. But the new title was more distinctive; it brought them into line with their opposite numbers in the Army and established them as commissioned officers. In 1867, master was renamed navigating-lieutenant, so at the same time second master was renamed navigating sub-lieutenant and the master's assistant was renamed navigating midshipman.
Mate was revived in 1913 for the accelerated promotion of promising ratings, and mates ranked with sub-lieutenants but messed separately. In 1931 the title was abandoned again, and mates were re-mustered as sub-lieutenants.
In the U.S. Navy, the rank of master's mate was established 1797 as a warrant officer rank, but it was disestablished in 1813. After 1843 no more warrants were issued but those who had been appointed continued to hold their office and received their pay. In 1865, it was replaced by the rating mate.
By an act of the United States Congress in 1906, the mates on the U.S. Navy retired list were promoted to the next higher grade if they had creditable American Civil War service, which most of them had. They were given warrant rank and rated with the lowest grade of warrant officer.
Master's mate was re-established in 1838 as a rating for experienced seamen, and was not considered a Warrant rank. At the same time sailing master was renamed master, master commandant was renamed commander, and some masters were commissioned as officers, formally "Master in line for Promotion" to distinguish them from the warrant masters who would not be promoted.
In 1865, master's Mate was changed to "mate", and the United States Secretary of the Navy was authorized to increase their pay and to rate them from Seaman to Ordinary Seaman who had enlisted in the naval service for not less than two years. The act of 15 July 1870 gave formal recognition to mates as part of the naval forces and their pay was fixed at $900 when at sea, $700 on shore duty, and $500 on leave or awaiting orders.
The quota of mates in the Navy was not fixed, but there was maximum of about 842 on 1 January 1865, during the Civil War. The Navy stopped making appointments to the rank of mate in 1870 but allowed those in serving in the position to remain in service. The U.S. Navy Register of Commissioned Officers of 1871 shows there were 130 mates on active duty as of January 1st.  The number gradually diminished until 1 July 1894 when there were only 27 remaining.
The Navy resumed appointing mates in 1897 in limited quantities. The 1899 Register shows a total of 34 mates on active duty with 12 being appointed in 1870 or earlier, 6 in 1897 and 16 in 1898. The revival of the rank of mate was only temporary as most of the remaining mates were promoted to the warrant officer rank of Boatswain in 1899. In the Navy Register of 1903 only 7 mates were listed as being on active duty. The Navy started appointing mates that year and by January 1, 1907 there were 39 on active duty. The revival was short lived as by January 1, 1908 there were no mates on active duty. 
Before 1 August 1894 there had been no authority for retirement of these men, but on that date a law was passed increasing the pay of those in the Navy and providing that they should have the same benefits of retirement as warrant officers. One purpose of the act was to make the retired pay of mates large enough to induce them to retire. By an act of Congress in 1906, the mates on the U.S. Navy retired list were promoted to the next higher grade if they had creditable Civil War service, which most of them had. They were given warrant rank and rated with the lowest grade of warrant officer. They were still called mates, but whether they were officers or enlisted men apparently was not clear. A year after the passage of this act the Attorney General of the United States published the legal opinion that mates "occupy the status of both officers in the Navy and enlisted men".
In the merchant service, master's mates were the officers immediately subordinate to the master and frequently divided by seniority into first, second, third (etc.) mate which evolved into the modern terms First Mate, Second Mate and Third Mate. Since the 1930s, there has been a tendency in the merchant service to replace mate with officer (e.g. First Officer).