William Ely (1765–1817) was an American lawyer and politician who served as a United States Representative from Massachusetts.
Born in West Springfield, Massachusetts, Ely graduated from Yale College in 1787. He studied law, was admitted to the bar, and commenced practice in Springfield. He served as a member of the Massachusetts House of Representatives and the Massachusetts State Senate.
Ely was elected as a Federalist to the Ninth and to the four succeeding Congresses, serving from March 4, 1805, to March 3, 1815. He was not a candidate for renomination in 1814. After leaving Congress, he resumed the practice of law in Springfield, where he died on November 19, 1817. He was interred in Peabody Cemetery.