Nils Johan Andersson, a Swedish botanist and traveller, studied at the University of Uppsala from 1840 to 1845 and obtained a doctoral degree. From October 1851 to 1853 he was employed as the botanist of the first Swedish circumnavigation of the world in the frigate Eugenie, calling at Honolulu, Tahiti, San Francisco, Sydney, Manila, various South American ports, Cape Town, the Galapagos, Hong Kong, and Singapore. Among others he collected plants around Cape Town and Stellenbosch in April 1853. A Dutch translation of his book describing his travels, Eene reis om de wereld met het Zweedsch oorlogsfregat Eugenie, 1851-1853 was published in 1854.
From 1856 to the year before his death Andersson was professor of botany at Lund University and director of the Department of Botany of the Natural History Museum at Stockholm. He published on systematic botany and morphology, specialising in the study of the genus Salix (willows) and the families Cyperaceae and Gramineae, publishing many papers on their systematics and morphology.He also published on the botany of Scandinavia, the Galapagos Islands, and the East Indies. In 1875 he bought the main part of the South African herbarium of Otto W. Sonder*, comprising some 100 000 specimens, for the Natural History Museum of Stockholm. He was elected a member of the royal Swedish Academy of Sciences in 1859.