Werner was born in 1866 in Mulhouse, Alsace (which was then part of France, but which was annexed by Germany in 1871). He was raised as Roman Catholic. He was the fourth and last child of Jean-Adam Werner, a foundry worker, and his second wife, Salomé Jeanette Werner, who originated from a wealthy family. He went to Switzerland to study chemistry at the Swiss Federal Institute (polytechnikum) in Zurich. Still, since this institute was not empowered to grant doctorates until 1909, Werner received a doctorate formally from the University of Zürich in 1890. After postdoctoral study in Paris, he returned to the Swiss Federal Institute to teach (1892). In 1893 he moved to the University of Zurich, where he became a professor in 1895. In 1894 he became a Swiss citizen.
In his last year, he suffered from a general, progressive, degenerative arteriosclerosis, especially of the brain, aggravated by years of excessive drinking and overwork. He died in a psychiatric hospital in Zürich.
Werner died on 15 November 1919 of arteriosclerosis in Zürich at the age of 52.