William Cox was born October 22, 1856 in Maysville, Kentucky. He was the son of William Hopkinson and Elizabeth R. (Newman) Cox. His paternal grandfather, George Cox, immigrated from London, England in 1817 and founded a dry goods store in Maysville, Kentucky in 1819.
Cox was educated in the private schools of Maysville. He began working in the family store at age fifteen, and he and his brother George assumed operation of the store when their father died in 1885. In 1904, the brothers sold the successful business to the firm of D. Hunt and Son. In 1889, Cox became president of the State National Bank in Maysville, holding this position until 1901. He was also director of the Electric Light and Gas Company for a time.
Cox took an active part in the development of Maysville, financing the construction of the Cox Building in that city. He also owned a housing terrace on Market Street between Third and Fourth Streets in Maysville, which became known as the Cox Block of Maysville.
In 1880, Cox married Susan E. Farrow, niece of the Chief Justice Peters of the Kentucky Court of Appeals. They had one daughter, Roberta Stockton (Cox) Wheat. Cox and his wife were faithful adherents of the Episcopal church.
For seven years, Cox served on the Maysville City Council, presiding over the Council for five of those years. In 1888, he was chosen as the Republican nominee for a seat in the U.S. House of Representatives, but he declined the nomination. In November 1893, Cox was elected mayor of the city of Maysville. He was the first mayor of the city elected under the new Kentucky Constitution of 1891.
Cox was a delegate to the 1892 Republican National Convention that nominated Benjamin Harrison for a second term as President of the United States. He was chosen as Kentucky's representative to the delegation that officially notified Harrison of his renomination.
Cox was elected to represent Mason and Lewis counties in the Kentucky Senate. He was re-elected once, serving a total of eight years. During his term, he supported the local option solution to the question of prohibition. In 1906, he received every Republican vote in the legislature for election to the United States Senate, but lost to Democrat Thomas H. Paynter.