Thomas Williams was born in Greensburg, Pennsylvania on August 28, 1806, the son of Robert Williams, a Cecil County, Maryland native. He was educated at local schools and then enrolled in Dickinson College in Carlisle, Pennsylvania, graduating with the Class of 1825. He returned to Greensburg to study law under Judge Richard Coulter and was admitted to the Westmoreland County bar in 1828. Four years later he moved his practice to Pittsburgh. Though his mentor Coulter was a Jacksonian, Williams became a Whig in reaction to Jackson's anti-national bank stance. He edited the Whig journal The Advocate
and was elected to the State Senate in November 1838 and served until 1841. He also supported the campaign of William Henry Harrison in 1840. He delivered a widely applauded eulogy in the Pennsylvania Senate when Harrison died soon after taking office. Almost twenty five years later, he delivered another eulogy there for Abraham Lincoln.
With the collapse of the Whig platform, Williams returned to western Pennsylvania and devoted himself to building an impressive career in the law. He returned to politics as one of the original organizers of the Republican Party and was a member of its first national committee. He was elected to the State House in 1861 and in late 1862 was elected to the United States Congress for the 23rd District of Pennsylvania. He served from March 4, 1863 to March 3, 1869 in the 38th, 39th, and 40th Congresses. During all three terms he sat with the House Committee on the Judiciary; in this capacity he acted as one of seven House of Representative managers in the Senate impeachment trial of President Andrew Johnson in March 1868. Usually a moderate Republican when dealing with Reconstruction affairs, he possibly saw little future in a Congress dominated by Radical Republicans and did not stand for re-election in 1868, choosing to retire to Allegheny City, Pennsylvania.
In 1831, he married Sarah Donaldson Reynolds of Wilmington, Delaware. On June 16, 1872, Thomas Williams died in Allegheny City at the age of 63.