The unification of Germany into a politically and administratively integrated nation state officially occurred on 18 January 1871, in the Hall of Mirrors at the Palace of Versailles in France. Princes of the German states, excluding Austria, gathered there to proclaim Wilhelm I of Prussia as German Emperor after the French capitulation in the Franco-Prussian War. Unofficially, the de facto transition of most of the German-speaking populations into a federated organization of states had been developing for some time through alliances formal and informal between princely rulers, but in fits and starts. The self-interests of the various parties hampered the process over nearly a century of autocratic experimentation, beginning in the era of the Napoleonic Wars, which prompted the dissolution of the Holy Roman Empire of the German Nation in 1806, and the subsequent rise of German nationalism.
Unification exposed tensions due to religious, linguistic, social, and cultural differences among the inhabitants of the new nation, suggesting that 1871 only represented one moment in a continuum of the larger unification processes. The Holy Roman Emperor had been often called "Emperor of all the Germanies"; contemporary news accounts frequently referred to "The Germanies". In the empire, higher nobility were referred to as "Princes of Germany" or "Princes of the Germanies"—for the lands once called East Francia had been organized and governed as pocket kingdoms since before the rise of Charlemagne (800 AD). In the mountainous terrain of much of the territory, isolated peoples developed cultural, educational, linguistic, and religious differences over such a lengthy time period. By the nineteenth century, transportation and communications improvements brought these regions closer together.
The Holy Roman Empire of the German Nation, which had included more than 500 independent states, was effectively dissolved when Emperor Francis II abdicated (6 August 1806) during the War of the Third Coalition. Despite the legal, administrative, and political disruption associated with the end of the Empire, the people of the German-speaking areas of the old Empire had a common linguistic, cultural, and legal tradition further enhanced by their shared experience in the French Revolutionary Wars and Napoleonic Wars. European liberalism offered an intellectual basis for unification by challenging dynastic and absolutist models of social and political organization; its German manifestation emphasized the importance of tradition, education, and linguistic unity of peoples in a geographic region. Economically, the creation of the Prussian Zollverein (customs union) in 1818, and its subsequent expansion to include other states of the German Confederation, reduced competition between and within states. Emerging modes of transportation facilitated business and recreational travel, leading to contact and sometimes conflict among German speakers from throughout Central Europe.
The model of diplomatic spheres of influence resulting from the Congress of Vienna in 1814–15 after the Napoleonic Wars endorsed Austrian dominance in Central Europe. The negotiators at Vienna took no account of Prussia's growing strength within and among the German states and so failed to foresee that Prussia would rise to challenge Austria for leadership of the German peoples. This German dualism presented two solutions to the problem of unification: Kleindeutsche Lösung, the small Germany solution (Germany without Austria), or Großdeutsche Lösung, the greater Germany solution (Germany with Austria).
Historians debate whether Otto von Bismarck—Minister President of Prussia—had a master plan to expand the North German Confederation of 1866 to include the remaining independent German states into a single entity or simply to expand the power of the Kingdom of Prussia. They conclude that factors in addition to the strength of Bismarck's Realpolitik led a collection of early modern polities to reorganize political, economic, military, and diplomatic relationships in the 19th century. Reaction to Danish and French nationalism provided foci for expressions of German unity. Military successes—especially those of Prussia—in three regional wars generated enthusiasm and pride that politicians could harness to promote unification. This experience echoed the memory of mutual accomplishment in the Napoleonic Wars, particularly in the War of Liberation of 1813–14. By establishing a Germany without Austria, the political and administrative unification in 1871 at least temporarily solved the problem of dualism.