Hofmann was born in Baden, Switzerland. He studied chemistry at the University of Zürich. His main interest was the chemistry of plants and animals, and he studied about the chemical structure of the common animal substance chitin. Hofmann worked at the pharmaceutical-chemical department of Sandoz Laboratories in Basel.