William Petyt (or Petit) (1640/1641 – 3 October 1707) was an English barrister and writer, and a political propagandist in the Whig interest.
Petyt was born in 1640 or 1641 in the village of Storiths, near Bolton Abbey, Skipton, Yorkshire, and educated at the Free Grammar School (now Ermysted's Grammar School), Skipton, and Christ's College, Cambridge. He was admitted as a barrister to the Middle Temple in June 1660, and to Barnard's Inn in June 1661. He was specially admitted to the Inner Temple on 25 November 1664, and subsequently called to the Bar there in February 1671 and made a bencher in 1689. He served as Treasurer (that is, the head) of Inner Temple in 1701–1702.
On 25 July 1689, Petyt was appointed Keeper of the Records in the Tower of London by William III, replacing in that position Robert Brady who had made a very effective attack for the Tories on Petyt's The Antient Right of the Commons of England Asserted (1680). Petyt was attacked also from his own side, the Whigs, by Thomas Hunt.
Petyt wrote against the separation of powers, and in favour of Parliament's control of the judiciary. Influential in its time, in particular on John Locke, was a version of "ancient constitutionalism" propounded in the writings of John Sadler, James Tyrrell and Petyt.