William M. Farmer (June 5, 1853 – August 28, 1931) was an American jurist and politician.
Born in Fayette County, Illinois, Farmer went to McKendree University and then received his law degree from Northwestern University School of Law in 1876. Farmer then practiced law in Vandalia, Illinois. He served as state's attorney for Fayette County and was a Democrat. In 1889, Farmer served in the Illinois House of Representatives and then in 1891, served in the Illinois State Senate. In 1897, he served as Illinois Circuit Court judge and then as Judge of the Illinois Appellate Court. He served on the Illinois Supreme Court from 1906 until his retirement in May 1931. Farmer served as chief justice of the supreme court. He died in his home in Vandalia, Illinois as a result of a stroke.