In the Royal Navy, the master was originally a warrant officer who ranked with, but after, the lieutenants. The rank became a commissioned officer rank and was renamed navigating lieutenant in 1867; the rank gradually fell out of use from around 1890 since all lieutenants were required to pass the same examinations.
When the United States Navy was formed in 1794, master was listed as one of the warrant officer ranks and ranked between midshipmen and lieutenants. The rank was also a commissioned officer rank from 1837 until it was replaced with the current rank of lieutenant, junior grade in 1883.
Until 1733 the sailing masters in the Imperial Russian Navy were rated as petty officers, but in that year the rank of Master was introduced after the British model. Masters ranked above sub-lieutenants, but under lieutenants. Meritorious masters could be given lieutenant's rank, but only if they were noblemen. In 1741 the rank of master was abolished, and the officers holding that rank were promoted to lieutenants, while second masters and master's mates became ensigns. Henceforth masters could be promoted to sea officers, even if they were commoners. 
The Pauline military reforms also included the navy, and the sailing department henceforth contained masters of VIII Class (rank as lieutenant commanders); masters of IX Class (below lieutenant commander but above lieutenant); masters of XII Class (rank as sub-lieutenants); masters of XIV Class (junior to sub-lieutenants); as well as master's mates and master's apprentices which were rated as petty officers. 
In 1827 a navigation corps was founded, which also was in charge of the hydrographic service. In common with other non-executive corps in the Russian navy, members of the navigation corps were given military ranks. This corps contained one major general, and a number of colonels, lieutenant colonels, captains, staff captains, lieutenants, second lieutenants and ensigns, as well as conductors (warrant officers). In 1885 the navigation corps was put under abolishment, and its responsibilities were transferred to the executive corps.  
Spanish sailing masters belonged to a navigation corps, called Cuerpo de Pilotos. They were, unlike their British counterparts, theoretically trained at the famous navigation schools, called Real Colegios Seminarios de San Telmo, in Seville and Málaga. In order to be accepted at these schools, the applicant had to be a Spaniard between eight and 14 years of age. Colored persons, Romani people, heretics, Jews, those punished by the Inquisition, and those whose parents pursued disreputable professions, were not eligible for enrollment. The master's apprentices were called meritorios de pilotaje and were at sea rated as common seamen. In order to become a master's assistant, called pilotín, during the 18th century, three voyages in Europe and one back and forth to America was required, as well as having passed a special examination. Promotion to second master could only take place if a berth was available. 
Masters, called primeros pilotos, were originally ranked as ensigns, while the second masters, called pilotos, were ranked below officers but above petty officers. Later the masters were given rank as lieutenant commanders or lieutenants, while the second masters were ranked as sub-lieutenants or ensigns according to seniority. Master's assistant lacked formal rank. From 1821, masters ranked as lieutenants, second masters as sub-lieutenants, and third masters as ensigns. Promotion from the navigation corps to the sea officer corps was not unusual. 
Early on, members of the navigation corps sought to improve its status. It was not until 1770, however, that the sailing masters received a uniform different from the petty officers. Under royal orders members of the navigation corps were from 1781 to be called Don, be regarded as caballeros ( gentlemen), carry small swords, and take oaths by swearing by a crucifix. In 1823, the senior ranks of the navigation corps was transferred to the executive corps, and in 1846 the corps was abolished and its remaining members included among the sea officers with the rank of sub-lieutenant. 
Sailing master (ansvarsstyrman, literally: "responsible navigator") was in the Royal Swedish Navy until 1868 a berth, held by the ship's senior warrant officer of the sailing branch, in charge of navigation, steering, anchors, and ballast. In 1868, the responsibility for navigation was transferred to a commissioned officer berth, the navigating officer, and the sailing master became an assistant navigator in charge of navigation stores. 
In the Middle Ages, when 'warships' were typically merchant vessels hired by the crown, the man in charge of the ship and its mariners, as with all ships and indeed most endeavours ashore, was termed the master; the company of embarked soldiers was commanded by their own captain.
From the time of the reforms of Henry VIII, the master was a warrant officer, appointed by the Council of the Marine (later the Navy Board) who also built and provisioned the Navy's ships. The master was tasked with sailing the ship as directed by the captain, who fought the ship when an enemy was engaged. The captain had a commission from (and was responsible to) the Admiralty, who were in charge of the Navy's strategy and tactics.
The master's main duty was navigation, taking the ship's position at least daily and setting the sails as appropriate for the required course and conditions. During combat, he was stationed on the quarterdeck, next to the captain. The master was responsible for fitting out the ship, and making sure they had all the sailing supplies necessary for the voyage. The master also was in charge of stowing the hold and ensuring the ship was not too weighted down to sail effectively. The master, through his subordinates, hoisted and lowered the anchor, docked and undocked the ship, and inspected the ship daily for problems with the anchors, sails, masts, ropes, or pulleys. Issues were brought to the attention of the master, who would notify the captain. The master was in charge of the entry of parts of the official log such as weather, position, and expenditures.  
Masters were promoted from the rank of the master's mates, quartermasters, or midshipmen. Masters were also recruited from the merchant service. A prospective master had to pass an oral examination before a senior captain and three masters at Trinity House.  After passing the examination, they would be eligible to receive a warrant from the Navy Board, but promotion was not automatic. 
Second master was a rating introduced in 1753 that indicated a deputy master on a first-, second- or third-rate ship-of-the-line. 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. Master's mates would act as second master of vessels too small to be allocated a warranted master.  Second masters were paid significantly more than master's mates, £5 5s per month.  Second masters were given the first opportunity for master vacancies as they occurred. 
Originally, the sailing master did not have an official officer uniform, which caused problems when they were captured because they had trouble convincing their captors they should be treated as officers and not ordinary sailors. In 1787 the warrant officers of wardroom rank (master, purser and surgeon) received an official uniform, but it did not distinguish them by rank. In 1807, masters, along with pursers, received their own uniform. 
By the classic Age of Sail the Master in the Royal Navy had become the warrant officer trained specifically in navigation, the senior warrant officer rank, and the second most important officer aboard rated ships.  In 1808, Masters (along with Pursers and Surgeons) were given similar status to commissioned officers, as warrant officers of wardroom rank. The master ate in the wardroom with the other officers, had a large cabin in the gunroom, and had a smaller day cabin next to the captain's cabin on the quarterdeck for charts and navigation equipment. 
However, the number of sailing-masters halved from 140 to 74 between the years 1840–1860:  partly because the pay and privileges were less than equivalent ranks in the military branch, and also because the master's responsibilities had been largely assumed by the executive officers.   In 1843 the wardroom warrant officers were given commissioned status. The Admiralty, under the First Lord of the Admiralty the Duke of Somerset, began to phase out the title of master after 1862.  The ranks of staff commander and staff captain were introduced in 1863 and 1864 respectively; and in 1867 the Masters Branch was re-organised as the Navigating Branch with a new pay scale, with the following ranks:  
The Royal Naval College exams for navigating lieutenant and lieutenant were the same after 1869.  By 1872 the number of navigating cadets had fallen to twelve, and an Admiralty experiment in 1873 under the First Sea Lord George Goschen further merged the duties of navigating lieutenants and sailing masters with those of lieutenants and staff commanders.  There were no more masters warranted after 1883, and the last one retired in 1892. 
Although the actual rank of navigating lieutenant fell out of use about the same time,  lieutenants who had passed their navigating exams were distinguished in the Navy List by an N in a circle by their name, and by N† for those passed for first-class ships. The last staff commander disappeared in around 1904, and the last staff captain left the Active List in 1913.  
An anonymous article in The Naval Review in 1927  included a number of suggestions for the instruction and duties of Navigating Officers: the author recommended that they should complete (as part of their first-class ship course) a period of one or two months at either the Naval Staff College or the Senior Officers' Technical School at Portsmouth. During this period they were to be instructed in:
They should also, during their time at the Navigation School, be more fully instructed in: 
"In ships at sea the navigating officer should be regarded as the Captain's Staff Officer. All Operational questions should be dealt with by him and the captain should regard him as his expert assistant in such matters. The drafting of orders and the writing of reports on operations, exercises, etc., should be his responsibility and not that of the captain's secretary." 
Master, originally sailing master, was a historic warrant officer rank of the United States Navy, above that of a midshipman, after 1819 passed midshipman, after 1862 ensign, and below a lieutenant. 
Some masters were appointed to command ships, with the rank of master commandant.  In 1837, 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. 
After 1855, passed midshipmen who were graduates of the Naval Academy filled the positions of master.  Both the commissioned officer rank of master and warrant officer rank of master were maintained until both were merged into the current rank of lieutenant, junior grade on 3 March 1883. 
In 1862 masters wore a gold bar for rank insignia, which became a silver bar in 1877. In 1881 they started wearing sleeve stripes of one 1⁄2-inch (13 mm) and one 1⁄4-inch-wide (6.4 mm) strip of gold lace, still used for the rank of lieutenant, junior grade.