Submarines in Her Majesty's service have the prefix HM Submarine (sometimes abbreviated HMSm). Similarly, the Royal Yacht Britannia, which was a commissioned ship in the Royal Navy, was known as HMY Britannia. Otherwise all ships in the Royal Navy are known as HM Ships, though formerly when a distinction was made between three-masted ship-rigged ships and smaller vessels they would be called HM Frigate X, or HM Sloop Y. The term prefix HMS is also used by shore establishments which are commissioned "ships" in the Royal Navy.
British government ships not in the Royal Navy have other designations, such as "RFA" for ships in the Royal Fleet Auxiliary.
Other Commonwealth Realms use a variation of the "HMS" designation. For example, Canada uses HMCS for "Her Majesty's Canadian Ship", Australia uses HMAS, and so forth. (See ship prefix for a list.)