The territory evolved out of the Breisgau, an early medieval county in the Duchy of Swabia. A continuous sequence of counts is known since 962; the counts belong to the House of Zähringen. In 1061, the counts first acquired the additional title of Margrave of Verona. Even though they lost the March of Verona soon thereafter, they kept the title of margrave. In 1112, the title of Margrave of Baden was first used. For most of the early modern period, the Margraviate of Baden was divided into two parts, one ruled by the Catholic Margraves of Baden-Baden, and the other by the Protestant Margraves of Baden-Durlach. In 1771, the main Baden-Baden line became extinct, and all of the Baden lands came under the rule of the Baden-Durlach line. The reunited margraviate existed until 1803. During the Napoleonic era, in the imperial reorganisation of 1803, Baden gained a great deal of additional territory, and its rulers were made one of the few prince-electors of the Holy Roman Empire. However, this pre-eminent dignity lasted only for three years until the end of the empire in August 1806, eight months after the crushing Battle of Austerlitz, when the Electorate of Baden ceased to exist. Consequently, in 1806, the ruler of Baden took on the title of Grand Duke of Baden and gained additional territory. The Grand Duchy of Baden, within approximately the borders of 1806, continued to exist until the fall of the German monarchies in 1918 when it became the Republic of Baden.
During the 11th century, the Duchy of Swabia lacked a powerful central authority and was under the control of various comital dynasties, the strongest of them being the House of Hohenstaufen, the House of Welf, the Habsburgs and the House of Zähringen. Emperor Henry III had promised the ducal throne to the Zähringen scion Berthold, however, upon Henry's death in 1056, his widow Agnes of Poitou appointed Rudolf of Rheinfelden as Duke of Swabia. Berthold renounced his rights and was compensated with the Duchy of Carinthia and the March of Verona in Italy. Not able to establish himself, he finally lost both territories, when he was deposed by King Henry IV of Germany during the Investiture Controversy in 1077. Berthold retired to his Swabian home territory, where he died the next year. The Veronese margravial title was nevertheless retained by his eldest son, Herman I. Herman II, son of Herman I and grandson of Berthold, had concluded an agreement with the rival Hohenstaufen dynasty, and about 1098 was enfeoffed with immediate territory by Emperor Henry IV. He chose to establish his residence in Germany, as he had been born and raised there. His lordship of choice was Baden, where his father had gained the right to rule by marrying the heiress, Judit von Backnang-Sulichgau, Countess of Eberstein-Calw. In Baden, Herman II had Hohenbaden Castle built. Construction began about 1100, and when it was completed in 1112, he marked the occasion by adopting the title of Margrave of Baden.