Carl Heinrich Hagen was born into a well connected family of middle-class intellectuals in Königsberg. His father, Karl Gottfried Hagen (1749–1829) was a distinguished chemist. The novelist Ernst August Hagen was his brother. The physicist-astronomer Friedrich Bessel and the mineralogist-physicist Franz Ernst Neumann became his brothers in law. The royal family were obliged to relocate for several years to the city following October 1806. Hagen frequently accompanied his father on visits to the royal court where during 1808/09 his father tutored the Princes Frederick-William and William, two future Prussian kings, on pharmaceutical and related matters.