Frederick IV (Danish: Frederik; 11 October 1671 – 12 October 1730) was King of Denmark and Norway from 1699 until his death. Frederick was the son of Christian V of Denmark-Norway and his wife Charlotte Amalie of Hesse-Kassel.

 Frederick was born on 11 October 1671 at Copenhagen Castle as the eldest son of King Christian V and his spouse Charlotte Amalie of Hesse-Kassel. The newborn prince was baptised the same evening with the name Frederick by the royal confessor Hans Leth. His grandfather King Frederick III had died a year and a half before he was born, and as the eldest son of the ruling King he was thus Crown Prince from birth. At the age of 18, he was given a seat on the Council of State as the heir apparent to the throne.
 As Crown Prince, Frederick broadened his education by travelling in Europe, led by his chamberlain Ditlev Wibe. He was particularly impressed by the architecture in Italy and, on his return to Denmark, asked his father for permission to build a summer palace on Solbjerg, as the hill in Valby was then known, the future site of Frederiksberg Palace. The one-storey building, probably designed by Ernst Brandenburger, was completed in 1703.
 Frederick was allowed to choose his future wife from a number of Protestant royal daughters in northern Germany. In 1695, he visited the court of Gustav Adolph, Duke of Mecklenburg-Güstrow in Güstrow. But his visit there was cut short by a message telling of his brother Prince Christian's serious illness (he had, in fact, already died in Ulm). Frederick later returned to Güstrow, where he was forced to choose the eldest of the unmarried princesses. On 5 December 1695 at Copenhagen Castle, he married Louise of Mecklenburg-Güstrow, herself a great-great-granddaughter of Frederick II of Denmark. 
 At the death of Christian V on 25 August 1699, the couple became King and Queen of Denmark-Norway. They were crowned on 15 April 1700 in the chapel of Frederiksborg Palace.
 Frederick's most important domestic reform was the abolition in 1702 of the so-called vornedskab, a kind of serfdom which had applied to the peasants of Zealand since the Late Middle Ages. His efforts were largely in vain because of the introduction in 1733 of adscription (stavnsbånd), a law that forced peasants to remain in their home regions, by which the peasantry were subjected to both the local nobility and the army.
 After the Great Northern War, trade and culture flowered. The first Danish theatre, Lille Grønnegade Theatre, was created and the great dramatist Ludvig Holberg (1684–1754) began his career. He established the College of Missions which funded the missionary Hans Egede (1686–1758) in taking forward the colonisation of Greenland. Politically this period was marked by the King's connection to the Reventlows, the Holsteiner relatives of his second queen, and by his growing suspicion of the old nobility.

 During Frederick's rule Copenhagen was struck by two disasters: the plague of 1711, and the great fire of October 1728, which destroyed most of the medieval capital.  The King had been persuaded by astronomer Ole Rømer (1644–1710) to introduce the Gregorian calendar in Denmark-Norway in 1700, but the astronomer's observations and calculations were among the treasures lost to the fire.
 Frederik IV, having twice visited Italy, had two pleasure palaces built in the Italian baroque style: Frederiksberg Palace was extended during his reign, when it was converted into a three-storey H-shaped building, completed in 1709 by Johan Conrad Ernst, giving the palace a true Italian baroque appearance and Fredensborg Palace, both considered monuments to the conclusion of the Great Northern War.
 
 Frederick IV holds a memorable place in the social history of the city of Venice due to a visit he made during the winter of 1708–09. The King stayed in the city with an entourage of at least 70 people, formally incognito as Count of Oldenburg, not to be unknown, but in order to avoid the cumbersome and costly etiquette of a royal visit. During his nine-week stay, the King was a frequent guest at operas and comedies and a generous buyer of Venetian glass. During the visit to the state armoury, he received the republic's gift: two large ore guns and an ore mortar. A regatta on the Grand Canal was held in his honour and is immortalised in a painting by Luca Carlevarijs. The winter that year was particularly cold, so cold that the lagoon of Venice froze over, and the Venetians were able to walk from the city to the mainland. It was joked that the king of Denmark had brought the cold weather with him. He also paid a visit to the dowager grand-princess Violante at the grand-ducal court of the Medicis.
 On his return from he led political negotiations with the Elector Augustus of Saxony and Frederick I of Prussia about the impending plans of war against Sweden. For much of Frederick IV's reign Denmark-Norway was engaged in the Great Northern War (1700–1721) against Sweden. In spite of the conclusion of the Peace of Travendal in 1700, there was soon a Swedish invasion and threats from Europe's western naval powers. In 1709 Denmark again entered the war, encouraged by the Swedish defeat at Poltava. Frederick IV commanded the Danish troops at the Battle of Gadebusch in 1712. Although Denmark-Norway emerged on the victorious side, she failed to regain her lost possessions in southern Sweden. The most important result was the destruction of the pro-Swedish Duchy of Holstein-Gottorp, which re-established Denmark's domination in Schleswig-Holstein. Between 1703 and 1711, Frederick sent military units to Hungary and supported Austria in the Rákóczi's War of Independence. The Danish regiments fought against the Kuruc army and French auxiliaries (Battle of Zsibó).
 Much of the King's life was spent in strife with kinsmen. Two of his first cousins, Charles XII of Sweden and Frederick IV, Duke of Holstein-Gottorp (the three men were the grandsons of Frederick III of Denmark), had waged war upon his father jointly. Initially defeated by the Swedes and forced to recognise the independence of Holstein-Gottorp, Frederick finally drove the next duke of Holstein-Gottorp, Duke Charles Frederick (who was Frederick IV's first cousin once removed) out of Schleswig in 1713, and avoided the revenge contemplated by Charles Frederick's mother-in-law, Catherine I of Russia.
 Frederick was deemed a man of responsibility and industry — often regarded as the most intelligent of Denmark-Norway's absolute monarchs. He seems to have mastered the art of remaining independent of his ministers. Lacking all interest in academic knowledge, he was nevertheless a patron of culture, especially art and architecture. His main weaknesses were probably pleasure-seeking and womanising, which sometimes distracted him. He was the penultimate Danish king to make a morganatic marriage (the last was Frederick VII with Louise Rasmussen aka "Countess Danner").
 Without divorcing Queen Louise, in 1703 he married Elisabeth Helene von Vieregg (d.1704). After the death of Elisabeth, he entered into a romance with her lady-in-waiting Charlotte Helene von Schindel, though he later lost interest in her. In 1711, Frederick fell in love with 19-year-old Countess Anne Sophie Reventlow, daughter of the then Grand-Chancellor Conrad von Reventlow. He carried her off from her home, Clausholm Castle near Randers, after her mother refused to let her daughter be a royal mistress. Frederick had seen Anne Sophie at a masquerade ball at Koldinghus, where the royal family resided during the plague that devastated Copenhagen. A secret marriage was held at Skanderborg on 26 June 1712. At that time he accorded her the title "Duchess of Schleswig" (derived from one of his own subsidiary titles). Three weeks after Queen Louise's death in Copenhagen on 4 April 1721, he legalised his relationship with Anna Sophie by a new marriage, this time declaring her queen consort (the only wife of a hereditary Danish king to bear that title who was not a princess by birth). It was undoubtedly a relief to regularise a relationship they both saw as sinful. Of the nine children born to him of these three wives, only two of them survived to adulthood: the future Christian VI and Princess Charlotte-Amalia, both from the first marriage. All the other children died in infancy.
 The Reventlows took advantage of their kinship to the King. Anna's sister, the salonist Countess Christine Sophie Holstein of Holsteinborg, was nicknamed Madame Chancellor because of her influence. Within a year of making Anna Queen, Frederick also recognized as dynastic the issue of the morganatic marriages of two of her kinsmen, Duke Philip Ernest of Schleswig-Holstein-Glucksburg (1673–1729) and Duke Christian Charles of Schleswig-Holstein-Plön-Norburg (1674–1706), to non-royal nobles. The other Schleswig-Holstein dukes of the House of Oldenburg perceived their interests to be injured, and Frederick found himself embroiled in complicated lawsuits and petitions to the Holy Roman Emperor. Also offended by the Countess's elevation were Frederick's younger unmarried siblings, Princess Sophia Hedwig (1677–1735) and Prince Charles (1680–1729), who withdrew from Copenhagen to their own rival court at the handsomely re-modelled Vemmetofte Cloister (later a haven for dowerless damsels of the nobility).
 During the King's last years he had dropsy (oedema), and was also affected by the consequences of an accident in an explosion in a cannon foundry in Copenhagen. He also had private sorrows that inclined him toward Pietism, a form of faith that would rise to prevalence during the reign of his son. During his last years, Frederick IV asked for the loyalty of his son in order to protect Queen Anna Sophie. Despite the growing weakness, he set in 1730 on a muster travel; he reached Gottorp but had to return, and died in Odense, on the day after his 59th birthday. He was buried in Roskilde Cathedral, the site of the mausoleum of Danish royalty.
 With his first queen, Duchess Louise of Mecklenburg-Güstrow:
 With his second wife Elisabeth Helene von Vieregg:
 With his third wife and second queen, Countess Anne Sophie von Reventlow: