Prince William was born on 15 January 1776 at Palazzo Teodoli in via del Corso, Rome.
His father was Prince William, Duke of Gloucester and Edinburgh, the third son of the Prince of Wales.
His mother, Maria, was the illegitimate daughter of Edward Walpole and granddaughter of Robert Walpole.
As a great-grandson of George II he held the title of Prince of Great Britain with the style His Highness, not His Royal Highness, at birth.
The young prince was baptized at Teodoli Palace, on 12 February 1776 by a Rev Salter.
His godparents were the Duke and Duchess of Saxe-Gotha-Altenburg (his first cousin once-removed and his wife) and the Margrave of Brandenburg-Ansbach (his second cousin once-removed).

During his stay in Stockholm in 1802–1803, his interest and rumoured affair with Aurora Wilhelmina Koskull attracted a lot of attention, and he reportedly had plans to marry her.
Queen Charlotte recalled that William said of Koskull: "If she was your daughter, I would marry her!"

He was admitted to the University of Cambridge (Trinity College) in 1787, and granted his MA in 1790.
He set up his London home at 31 Upper Grosvenor Street, Mayfair.
 On 25 August 1805, Prince William's father died, and he inherited the titles Duke of Gloucester and Edinburgh and Earl of Connaught.

From 1811 until his death he was Chancellor of the University of Cambridge.
He was offered the position of king of Sweden in 1812 by some members of the Swedish nobility, but the British government would not allow it.
Prince William was born on 15 January 1776 at Palazzo Teodoli in via del Corso, Rome. His father was Prince William, Duke of Gloucester and Edinburgh, the third son of the Prince of Wales. His mother, Maria, was the illegitimate daughter of Edward Walpole and granddaughter of Robert Walpole. As a great-grandson of George II he held the title of Prince of Great Britain with the style His Highness, not His Royal Highness, at birth. The young prince was baptized at Teodoli Palace, on 12 February 1776 by a Rev Salter. His godparents were the Duke and Duchess of Saxe-Gotha-Altenburg (his first cousin once-removed and his wife) and the Margrave of Brandenburg-Ansbach (his second cousin once-removed).
During his stay in Stockholm in 1802–1803, his interest and rumoured affair with Aurora Wilhelmina Koskull attracted a lot of attention, and he reportedly had plans to marry her. Queen Charlotte recalled that William said of Koskull: "If she was your daughter, I would marry her!"
He was admitted to the University of Cambridge (Trinity College) in 1787, and granted his MA in 1790. He set up his London home at 31 Upper Grosvenor Street, Mayfair.  On 25 August 1805, Prince William's father died, and he inherited the titles Duke of Gloucester and Edinburgh and Earl of Connaught. 
From 1811 until his death he was Chancellor of the University of Cambridge. He was offered the position of king of Sweden in 1812 by some members of the Swedish nobility, but the British government would not allow it.
Prince William Frederick, Duke of Gloucester and Edinburgh