Born in Queen's Square, Bayswater, he was the eldest surviving son of the barrister John Williams. He was educated first at Winchester College from 1808, but moved to Westminster School in 1811. He entered Trinity College, Cambridge, as a scholar in 1816, and graduated B.A. 1820 and M.A. 1824.
On leaving Cambridge Williams entered Lincoln's Inn as a student, and, after reading in the chambers of John Patteson and then with John Campbell, was called to the bar on 17 June 1823. He first joined the Oxford Circuit, where he soon found work; but when South Wales was detached and became an independent circuit, he travelled on that and the Chester Circuit.
In October 1846 Williams was made a puisne judge of the court of common pleas, and received knighthood on 4 February 1847. Some of his major judgments were in the following cases: Earl of Shrewsbury v. Scott, 6 CB. NS. 1 (Roman Catholic disabilities); Behn v. Burness, 1 B. & S. 877 (warranties in charter parties); Johnson v. Stear, 15 CB. NS. 30 (measures of damages in trover); and Spence v. Spence, 31 L. J. C. P. 189 (application of Rule in Shelley's Case).
Williams retired from the bench in 1865 owing to increasing deafness; and was created a privy councillor and a member of the Judicial Committee of the Privy Council. He died on 2 November 1875 at 24 Queen Anne's Gate, Westminster, which had been his home since 1836. He was buried at Wotton, near Dorking. A scholar and man of letters, he associated with Dean Milman, William Buckland, Richard Trench, and Henry George Liddell.
A portrait of the judge in oils, by James Sant, passed into the possession of the family.