Hansen married Anna Georgiana Cécile de Dompierre de Jonquiéres (27 February 1847 - 19 February 1941), a daughter of civil servant Godefroi Chrétien de Dompierre de Jonquiéres (1818-83) and Harriot Lindam (1820-84), on 29 September 1871 in the French Reformed Church in Copenhagen.