Vilas was born in Chelsea, Vermont, and moved to Madison, Wisconsin, with his family in 1851. He graduated from the University of Wisconsin-Madison in 1858, and from the University at Albany Law School in 1860. He enlisted in the Union Army during the Civil War and was a captain in the 23rd Wisconsin Volunteer Infantry and later served as the lieutenant colonel of that regiment.
Following the war, Vilas was a Professor of Law at the University of Wisconsin-Madison, and a regent of the University from 1880 to 1885 and 1898 to 1905. Vilas served as a member of the Wisconsin State Assembly in 1885, until he was appointed the Postmaster General between 1885 and 1888, and as Secretary of the Interior from 1888 to 1889, both under President Grover Cleveland.
After leaving the cabinet, he led Wisconsin Germans in the protest against the Bennett Law of 1889 which required schools to only use the English language. He served in the U.S. Senate from 1891 to 1897, being defeated for renomination.
He is interred at the Forest Hill Cemetery in Madison, Wisconsin.
Vilas County, Wisconsin is named for William F. Vilas.