Majesty
Majesty (abbreviated HM for Her Majesty or His Majesty, oral address Your Majesty; from the Latin maiestas, meaning "greatness") is used as a manner of address by many monarchs, usually kings or queens. Where used, the style outranks the style of (Imperial/Royal) Highness, but is inferior to the style of Imperial Majesty. It has cognates in many other languages, especially of Europe.

Origin
Originally, during the Roman republic, the word maiestas was the legal term for the supreme status and dignity of the state, to be respected above everything else. This was crucially defined by the existence of a specific case, called laesa maiestas (in later French and English law, lèse-majesté), consisting of the violation of this supreme status. Various acts such as celebrating a party on a day of public mourning, contempt of the various rites of the state and disloyalty in word or act were punished as crimes against the majesty of the republic.  However, later, under the Empire, it came to mean an offence against the dignity of the Emperor.

Style of a head of state
The term was first assumed by Charles V, who believed that—following his election as Holy Roman Emperor in 1519—he deserved a style greater than Highness, which preceding emperors and kings had used. Soon, Francis I of France and Henry VIII of England followed his example.After the fall of the Holy Roman Empire, Majesty was used to describe a monarch of the very highest rank— it was generally applied to God. Variations, such as Catholic Majesty (Spain) or Britannic Majesty (United Kingdom) are often used in diplomatic settings where there otherwise may be ambiguity (see a list).
A person with the title is usually addressed as Your Majesty, and referred to as His/Her Majesty, abbreviated HM; the plural Their Majesties is TM. Emperors (and empresses) use [His/Her/Their/Your] Imperial Majesty, HIM or TIM.
Princely and ducal heads usually use His Highness or some variation thereof (e.g., His Serene Highness). In British practice, heads of princely states in the British Empire were referred to as Highness.
In monarchies that do not follow the European tradition, monarchs may be called Majesty whether or not they formally bear the title of King or Queen, as is the case in certain countries and amongst certain peoples in Africa and Asia.
In Europe, the monarchs of Denmark, Norway, Sweden, the United Kingdom, Spain, the Netherlands and Belgium use the style. By contrast, the heads of state of Liechtenstein and Monaco, being principalities, use the inferior style of Serene Highness. Luxembourg, a Grand Duchy, accords its monarch the style of Royal Highness, as accorded to all other members of the Grand-Ducal Family, due to their descendance from Prince Félix of Bourbon-Parma. In the Holy See, the Pope – while ruling as Sovereign of the Vatican City State – uses the spiritual style of Holiness. Moreover, while Andorra is formally a monarchy, its Co-Princes – the bishop of Urgell (appointed by the Pope) and President of France – use the republican and non-royal style of Excellency. Andorra is the only non-hereditary, elective and appointive monarchy in Europe.

United Kingdom and the Commonwealth
In the United Kingdom, several derivatives of Majesty have been or are used, either to distinguish the British sovereign from continental kings and queens or as further exalted forms of address for the monarch in official documents or the most formal situations. Richard II, according to Robert Lacey in his book Great Tales from English history, was the first English King to demand the title of Highness or Majesty. He also noted that, '...previous English Kings had been content to be addressed as My Lord '.Most Gracious Majesty is used only in the most formal of occasions. Around 1519 King Henry VIII decided Majesty should become the style of the sovereign of England. Majesty, however, was not used exclusively; it arbitrarily alternated with both Highness and Grace, even in official documents. For example, one legal judgement issued by Henry VIII uses all three indiscriminately; Article 15 begins with, "The Kinges Highness hath ordered," Article 16 with, "The Kinges Majestie" and Article 17 with, "The Kinges Grace."
Pre-Union Scotland Sovereigns were only addressed as Your Grace. During the reign of James VI and I, Majesty became the official style, to the exclusion of others. In full, the Sovereign is still referred to as His (Her) Most Gracious Majesty, actually a merger of both the Scottish Grace and the English Majesty.
Britannic Majesty is the style used for the monarch and the crown in diplomacy, the law of nations, and international relations. For example, in the Mandate for Palestine of the League of Nations, it was His Britannic Majesty who was designated as the Mandatory for Palestine. Britannic Majesty is famously used in all British passports, where the following sentence is used:

His Britannic Majesty's Secretary of State Requests and requires in the Name of His Majesty all those whom it may concern to allow the bearer to pass freely without let or hindrance, and to afford the bearer such assistance and protection as may be necessary.
Most Excellent Majesty is mainly used in Acts of Parliament, where the phrase The King's (or Queen's) Most Excellent Majesty is used in the enacting clause. The standard is as follows:

BE IT ENACTED by the King's [Queen's] most Excellent Majesty, by and with the advice and consent of the Lords Spiritual and Temporal, and Commons, in this present Parliament assembled, and by the authority of the same, as follows:Wives of Kings are entitled to the style of Her Majesty, (such as Queen Camilla). Husbands of queen regnants do not have the same right, as was the case with Queen Elizabeth II's consort Prince Philip, Duke of Edinburgh, who had the style Royal Highness.

Japan
In Japan, the uses of honorific title Heika (Japanese: 陛下) for the Emperor of Japan, the Empress, the Grand Empress Dowager and the Empress Dowager are defined in The Imperial House Law since 1947.In 757, this term was first defined in Yōrō Code (Japanese: 養老律令) to use only when addressing the Reigning Emperor (Japanese: 今上天皇).
In Former Imperial House Law (1889), the use case of this term was expanded to include the Empress, the Grand Empress Dowager and the Empress Dowager.

Brunei
In Brunei, a Malay title for the Sultan of Brunei is officially Kebawah Duli Yang Maha Mulia Paduka Seri Baginda (KDYMMPSB) or unofficial simply Kebawah Duli. It literally means "Under the dust of the Most Exalted [God], The Victorious Sovereign".
It reflects the title of Zilullah-fil-Alam ("Shadow of God on Earth"), referring to the Sultan as having a small bit of God's immense power. The title paduka means "victorious" from Old Malay while seri is an honorific from Sanskrit. The title baginda is a third-person noun for royals and prophets.

Ancient China
In History of China after Han dynasty, the honorific (陛下; bìxià), referring to the Emperor of China (皇帝), was used.

Saudi Arabia
In Saudi Arabia, King Fahd abolished the style of Majesty in 1975 in favour of Custodian of the Two Holy Mosques, a style adopted by historical Islamic rulers. However, the King by custom continues to be referred to as Your Majesty in conversation.

Malaysia
In Malaysia, the Malay style for the Yang di-Pertuan Agong and the Raja Permaisuri Agong is Kebawah Duli Yang Maha Mulia Seri Paduka Baginda or simply Seri Paduka Baginda. The Sultan of Johor and the Permaisuri of Johor use the Malay style Duli Yang Maha Mulia (DYMM) which is equivalent to His/Her Majesty since 2017. Prior to that, they were addressed as His/Her Royal Highness in English, similar with the other eight royal state Malay rulers in Malaysia.

Burma
In Burma, the full Burmese title for the King of Burma Proper was officially Bhone Taw Kyi Hla Thaw Myanmar Min Myat Phya (Burmese: ဘုန်းတော်ကြီးလှသောမြန်မာမင်းမြတ်ဘုရား), shortened to Bhone Taw Kyi Phaya (Burmese: ဘုန်းတော်ကြီးဘုရား) or Ashin Paya (Burmese: အရှင်ဘုရား).

References
External links
 The dictionary definition of majesty at Wiktionary