Until the 19th century, the main market town and largest settlement of this area was Vị Xuyên, south of today's city. Under the Nguyễn dynasty, Hà Giang itself began to grow. In 1842 it became part of the new Tuyên Quang Province, which then stretched north to the Chinese border.
France conquered the area in 1886, and Hà Giang became an important colonial military outpost. On 13 August 1945 the Việt Nam Quốc Dân Đảng seized power here, as part of the August Revolution.
Hà Giang got its own province back in August 1991, split from Tuyên Quang. In September 2010 the town was upgraded to a provincial city. The 2019 census counted 55,559 people.
Since the Dong Van Karst Plateau Geopark was designated in 2010, tourism has been growing. The province is still among the poorest in Vietnam, and its roads, schools and health services trail much of the country. In March 2014 an Asian Development Bank aid package was approved to upgrade roads, build two new bridges and improve the sewage system in Hà Giang province.