Past Prime Ministers of the UK

Explore the full list of UK Prime Ministers, from Sir Robert Walpole in 1721 to the present day. Our interactive table makes it easy to search, filter, and sort through centuries of leadership.

You can quickly filter by political party, search by year to see who was in office at that time, or find a Prime Minister by entering part of their name. Each entry shows the leader’s party, years in office, and the duration of their term, giving you a clear view of Britain’s political history.

Select Political Party : to filter the data table below.

Prime Ministers Party Duration Years in office Count
Sir Robert WalpoleWhig1721-17421721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 174222
Spencer Compton, 1st Earl of WilmingtonWhig1742-17431742, 17432
Henry PelhamWhig1743-17541743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 175412
Thomas Pelham-Holles 1st Duke of NewcastleWhig1754-1756, 1757-17621754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 17629
William Cavendish Duke of DevonshireWhig1756-17571756, 17572
John Stuart, 3rd Earl of ButeTory1762-17631762, 17632
George GrenvilleWhig1763-17651763, 1764, 17653
Charles Watson-Wentworth, 2nd Marquess of RockinghamWhig1765-1766, 1782-17821765, 1766, 17823
William Pitt 'The Elder', 1st Earl of ChathamWhig1766-17681766, 1767, 17683
Augustus Henry Fitzroy, 3rd Duke of GraftonWhig1768-17701768, 1769, 17703
Lord Frederick NorthTory1770-17821770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 178213
William Petty, 2nd Earl of ShelburneWhig1782-17831782, 17832
William Cavendish-Bentinck Duke of PortlandWhig1783-1783, 1807-18091783, 1807, 1808, 18094
William Pitt 'The Younger'Tory and Whig1783-1801, 1804-18061783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1804, 1805, 180622
Henry Addington 1st Viscount SidmouthTory1801-18041801, 1802, 1803, 18044
William Wyndham Grenville, 1st Baron GrenvilleWhig1806-18071806, 18072
Spencer PercevalTory1809-18121809, 1810, 1811, 18124
Robert Banks Jenkinson Earl of LiverpoolConservative1812-18271812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 182716
George CanningTory1827-182718271
Frederick Robinson, Viscount GoderichTory1827-18281827, 18282
Arthur Wellesley, 1st Duke of WellingtonTory1828-1830, 1834-18341828, 1829, 1830, 18344
Charles Grey, 2nd Earl GreyWhig1830-18341830, 1831, 1832, 1833, 18345
William Lamb, 2nd Viscount MelbourneWhig1834-1834, 1835-18411834, 1835, 1836, 1837, 1838, 1839, 1840, 18418
Sir Robert Peel 2nd BaronetConservative1834-1835, 1841-18461834, 1835, 1841, 1842, 1843, 1844, 1845, 18468
Lord John Russell, 1st Earl RussellWhig1846-1852, 1865-18661846, 1847, 1848, 1849, 1850, 1851, 1852, 1865, 18669
Edward Smith Stanley, 14th Earl of DerbyTory and Whig1852-1852, 1858-1859, 1866-18681852, 1858, 1859, 1866, 1867, 18686
George Hamilton Gordon Earl of AberdeenConservative1852-18551852, 1853, 1854, 18554
Henry John Temple, 3rd Viscount PalmerstonWhig and Liberal1855-1858, 1859-18651855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 186511
Benjamin Disraeli, the Earl of BeaconsfieldConservative1868-1868, 1874-18801868, 1874, 1875, 1876, 1877, 1878, 1879, 18808
William Ewart GladstoneLiberal1868-1874, 1880-1885, 1886-1886, 1892-18941868, 1869, 1870, 1871, 1872, 1873, 1874, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1892, 1893, 189417
Robert Gascoyne-Cecil, 3rd Marquess of SalisburyConservative1885-1886, 1886-1892, 1895-19021885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 190216
Archibald Primrose, 5th Earl of RoseberyLiberal1894-18951894, 18952
Arthur James BalfourConservative1902-19051902, 1903, 1904, 19054
Sir Henry Campbell-BannermanLiberal1905-19081905, 1906, 1907, 19084
Herbert Henry AsquithLiberal1908-19161908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 19169
David Lloyd GeorgeLiberal1916-19221916, 1917, 1918, 1919, 1920, 1921, 19227
Andrew Bonar LawConservative1922-19231922, 19232
Stanley BaldwinConservative1923-1924, 1924-1929, 1935-19371923, 1924, 1925, 1926, 1927, 1928, 1929, 1935, 1936, 193710
James Ramsay MacDonaldLabour1924-1924, 1929-19351924, 1929, 1930, 1931, 1932, 1933, 1934, 19358
Neville ChamberlainConservative1937-19401937, 1938, 1939, 19404
Sir Winston ChurchillConservative1940-1945, 1951-19551940, 1941, 1942, 1943, 1944, 1945, 1951, 1952, 1953, 1954, 195511
Clement AttleeLabour1945-19511945, 1946, 1947, 1948, 1949, 1950, 19517
Sir Anthony EdenConservative1955-19571955, 1956, 19573
Harold MacmillanConservative1957-19631957, 1958, 1959, 1960, 1961, 1962, 19637
Sir Alec Douglas-HomeConservative1963-19641963, 19642
Harold WilsonLabour1964-1970, 1974-19761964, 1965, 1966, 1967, 1968, 1969, 1970, 1974, 1975, 197610
Sir Edward HeathConservative1970-19741970, 1971, 1972, 1973, 19745
James CallaghanLabour1976-19791976, 1977, 1978, 19794
Baroness Margaret ThatcherConservative1979-19901979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 199012
Sir John Major KG CHConservative1990-19971990, 1991, 1992, 1993, 1994, 1995, 1996, 19978
Sir Tony Blair KGLabour1997-20071997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 200711
Gordon BrownLabour2007-20102007, 2008, 2009, 20104
Lord CameronConservative2010-20162010, 2011, 2012, 2013, 2014, 2015, 20167
Theresa MayConservative2016-20192016, 2017, 2018, 20194
Boris JohnsonConservative2019-20222019, 2020, 2021, 20224
Elizabeth TrussConservative2022-202220221
The Rt Hon Rishi SunakConservative2022-20242022, 2023, 20243
Prime Ministers Party Duration Years in office Count

Longest and Shortest Terms: UK Prime Ministers have served for vastly different lengths of time. Sir Robert Walpole held office for 21 years, the longest in history, while Liz Truss lasted less than two months. Several leaders, such as William Gladstone and the Duke of Newcastle, even returned for multiple non-consecutive terms, something rare in modern politics.

Party Dominance Over Time: The list shows clear shifts in party power. The Whigs dominated the 18th century, while the Conservatives have produced most Prime Ministers since the 19th century. Labour and Liberal leaders appear in shorter but influential periods, highlighting the evolving political landscape.

From Aristocrats to MPs: Earlier Prime Ministers were often titled aristocrats—Dukes, Earls, and Viscounts—reflecting the influence of the peerage. By the 20th century, titles gave way to elected MPs, showing the transition from aristocratic leadership to modern parliamentary democracy.

Source of information: Past Prime Ministers - GOV.UK