Nilson was professor of analytical chemistry at Uppsala from 1878 until 1883, when he became professor of chemistry of the Royal Swedish Academy of Agriculture and Forestry in Stockholm. As an agricultural chemist and Director of the Agricultural Chemical Experiment Station, he published nearly sixty papers concerning topics such as soils and manures. As a result of his inquiries many of the swamps of Gothland were drained and cultivated. The sugar beet was introduced and became a major crop, as chalky moors were treated with potash fertilizers.
He also conducted studies of cow's milk and various plants for cattle fodder.
Nilson was elected a foreign member of the Chemical Society of Great Britain on February 2, 1888.
Nilson was a member of several other academies as well. He received several awards, including the Order of the Polar Star.