Ørsted was born in Rudkøbing in 1777. As a young boy he developed an interest in science while working for his father, who was a pharmacist in the towns pharmacy. He and his brother Anders received most of their early education through self-study at home, going to Copenhagen in 1793 to take entrance exams for the University of Copenhagen, where both brothers excelled academically. By 1796, Ørsted had been awarded honors for his papers in both aesthetics and physics. He earned his doctorate in 1799 for a dissertation based on the works of Kant entitled The Architectonics of Natural Metaphysics'.
In 1800, Alessandro Volta reported his invention of the voltaic pile, which inspired Ørsted to investigate the nature of electricity and to conduct his first electrical experiments. In 1801, Ørsted received a travel scholarship and public grant which enabled him to spend three years traveling across Europe. He toured science headquarters throughout the continent, including in Berlin and Paris.
In Germany Ørsted met Johann Wilhelm Ritter, a physicist who believed there was a connection between electricity and magnetism. This idea made sense to Ørsted as he subscribed to Kantian thought regarding the unity of nature. Ørsted's conversations with Ritter drew him into the study of physics. He became a professor at the University of Copenhagen in 1806 and continued research on electric currents and acoustics. Under his guidance the university developed a comprehensive physics and chemistry program and established new laboratories. 
Ørsted welcomed William Christopher Zeise to his family home in autumn 1806. He granted Zeise a position as his lecturing assistant and took the young chemist under his tutelage. In 1812, Ørsted again visited Germany and France after publishing  and  (1811).
Ørsted was the first modern thinker to explicitly describe and name the thought experiment. He used the Latin-German term  circa 1812 and the German term  in 1820.
In 1819 Ørsted was the first to extract piperine and subsequently name it. He extracted it from Piper nigrum, the plant from which both white and black pepper comes from.
Ørsted designed a new type of piezometer to measure the compressibility of liquids in 1822.