Charles Frederick (22 November 1728 – 10 June 1811) was Margrave, Elector and later Grand Duke of Baden (initially only Margrave of Baden-Durlach) from 1738 until his death. Born at Karlsruhe, he was the son of Hereditary Prince Frederick of Baden-Durlach and Amalia of Nassau-Dietz (13 October 1710 – 17 September 1777), the daughter of Johan Willem Friso of Nassau-Dietz.
He succeeded his grandfather as Margrave of Baden-Durlach in 1738 and ruled personally from 1746 until 1771, when he inherited Baden-Baden from the Catholic line of his family. This made him the Protestant ruler of a state that was overwhelmingly Catholic, however the Imperial Diet permitted this because the Elector of Saxony had converted to Catholicism from Lutheranism and had been permitted to retain control of the Protestant body of the Imperial Diet. Upon inheriting the latter margraviate, the original land of Baden was reunited. He was regarded as a good example of an enlightened despot, supporting schools, universities, jurisprudence, the civil service, the economy, culture, and urban development. He outlawed torture in 1767, and serfdom in 1783. He was elected a Royal Fellow of the Royal Society in 1747.
In 1803, Charles Frederick became Elector of Baden, and in 1806 the first Grand Duke of Baden. Through the politics of minister Sigismund Freiherr von Reitzenstein, Baden acquired the Bishopric of Constance, and the territories of the Bishopric of Basel, the Bishopric of Strassburg, and the Bishopric of Speyer that lay on the right bank of the Rhine, in addition to Breisgau and Ortenau.
In 1806, Baden joined the Confederation of the Rhine.
Together with his architect, Friedrich Weinbrenner, Charles Frederick was responsible for the construction of the handsome suite of classical buildings that distinguish Karlsruhe. He died there in 1811, and was one of the few German rulers to die during the Napoleonic era.