William S. Ramsey was born in Carlisle, Pennsylvania. He pursued classical studies in the United States and Europe, and served as attaché of the American Legation in London.
Ramsey was elected as a Democrat to the Twenty-sixth Congress and served until his death before the commencement of the Twenty-seventh Congress, to which he had been reelected. He died in Baltimore, Maryland, in 1840. Interment in Ashland Cemetery in Carlisle, Pennsylvania.