Sir William Rae, 3rd Baronet (14 April 1769 – 19 October 1842), was a Scottish politician and lawyer, a son of Sir David Rae, Lord Eskgrove.
He studied at Edinburgh University. He was Member of Parliament for Anstruther Burghs, in Fife, from 1819 to 1826, Harwich, Essex, England, from 1827 to 1830, Buteshire in 1830 and from 1833 to 1842, and for Portarlington, Queen's County, Ireland, from 1831 to 1832.
He served as Lord Advocate from 1819 to 1830 and from 1834 to 1835. He was made a Privy Councillor on 19 July 1830.
Grant's Old and New Edinburgh tells us that he was present at the Great Edinburgh Fire of 1824, actively trying to extinguish the flames of the building on the Royal Mile at the head of Old Assembly Close as it was "the house of his birth".
He is buried with his father and mother on the south-west corner of St. Michael's church in Inveresk. The stone is surprisingly modest.