Different monarchies use different algorithms or formulas to determine the line of succession. Chief among the lineal mechanisms are:
Salic Law (also called Agnatic Succession): refers to the complete exclusion of females of the dynasty and their descendants from the succession. Salic law applied to the former royal or imperial houses of Albania, France, Italy, Romania, Yugoslavia, and Prussia/German Empire. It currently applies to the royal or imperial houses of Japan, Jordan, and Nepal. Generally, hereditary monarchies that operate under Salic Law (Agnatic Succession) also use primogeniture among male descendants in the male line to determine the rightful successor.
Semi-Salic Law: According to the FAQ for the newsgroup alt.talk.royalty, under semi-Salic law, "the succession is reserved firstly to all the male dynastic descendants of all the eligible branches by order of primogeniture, then upon total extinction of these male descendants to the eldest of the dynastic female descendants." Current monarchies that operated under Semi-Salic law include Luxembourg and Liechtenstein. Former monarchies that operated under semi-Salic law included Austria (later Austria-Hungary), Bavaria, Hanover, Württemberg, Russia, Saxony, Tuscany, and the Kingdom of the Two Sicilies.
Primogeniture (or more properly Male Primogeniture) refers to a mechanism whereby male descendants of the sovereign take precedence over female descendants, with children representing their deceased ancestors, and where the senior line of descent always takes precedence over the junior line, in each gender. Elder sons always take precedence over younger sons. Younger sons always take precedence over older daughters. The right of succession always belongs to the eldest son of the reigning sovereign (see heir apparent), and then to the eldest son of the eldest son. This is the system in Great Britain, Spain (since 1978), Denmark, and Monaco.
Cognatic Primogeniture (or Absolute Primogeniture): a law in which the eldest child of the sovereign succeeds to the throne, regardless of gender, and where females (and their descendants) enjoy the same right of succession as males. This is currently the system in Belgium, the Netherlands, Norway, and Sweden.