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 Walpole | Whig | 1721-1742 | 1721, 1722, 1723, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742 | 22 |
Spencer Compton, 1st Earl of Wilmington | Whig | 1742-1743 | 1742, 1743 | 2 |
Henry Pelham | Whig | 1743-1754 | 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, 1752, 1753, 1754 | 12 |
Thomas Pelham-Holles 1st Duke of Newcastle | Whig | 1754-1756, 1757-1762 | 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, 1762 | 9 |
William Cavendish Duke of Devonshire | Whig | 1756-1757 | 1756, 1757 | 2 |
John Stuart, 3rd Earl of Bute | Tory | 1762-1763 | 1762, 1763 | 2 |
George Grenville | Whig | 1763-1765 | 1763, 1764, 1765 | 3 |
Charles Watson-Wentworth, 2nd Marquess of Rockingham | Whig | 1765-1766, 1782-1782 | 1765, 1766, 1782 | 3 |
William Pitt 'The Elder', 1st Earl of Chatham | Whig | 1766-1768 | 1766, 1767, 1768 | 3 |
Augustus Henry Fitzroy, 3rd Duke of Grafton | Whig | 1768-1770 | 1768, 1769, 1770 | 3 |
Lord Frederick North | Tory | 1770-1782 | 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782 | 13 |
William Petty, 2nd Earl of Shelburne | Whig | 1782-1783 | 1782, 1783 | 2 |
William Cavendish-Bentinck Duke of Portland | Whig | 1783-1783, 1807-1809 | 1783, 1807, 1808, 1809 | 4 |
William Pitt 'The Younger' | Tory and Whig | 1783-1801, 1804-1806 | 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1804, 1805, 1806 | 22 |
Henry Addington 1st Viscount Sidmouth | Tory | 1801-1804 | 1801, 1802, 1803, 1804 | 4 |
William Wyndham Grenville, 1st Baron Grenville | Whig | 1806-1807 | 1806, 1807 | 2 |
Spencer Perceval | Tory | 1809-1812 | 1809, 1810, 1811, 1812 | 4 |
Robert Banks Jenkinson Earl of Liverpool | Conservative | 1812-1827 | 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827 | 16 |
George Canning | Tory | 1827-1827 | 1827 | 1 |
Frederick Robinson, Viscount Goderich | Tory | 1827-1828 | 1827, 1828 | 2 |
Arthur Wellesley, 1st Duke of Wellington | Tory | 1828-1830, 1834-1834 | 1828, 1829, 1830, 1834 | 4 |
Charles Grey, 2nd Earl Grey | Whig | 1830-1834 | 1830, 1831, 1832, 1833, 1834 | 5 |
William Lamb, 2nd Viscount Melbourne | Whig | 1834-1834, 1835-1841 | 1834, 1835, 1836, 1837, 1838, 1839, 1840, 1841 | 8 |
Sir Robert Peel 2nd Baronet | Conservative | 1834-1835, 1841-1846 | 1834, 1835, 1841, 1842, 1843, 1844, 1845, 1846 | 8 |
Lord John Russell, 1st Earl Russell | Whig | 1846-1852, 1865-1866 | 1846, 1847, 1848, 1849, 1850, 1851, 1852, 1865, 1866 | 9 |
Edward Smith Stanley, 14th Earl of Derby | Tory and Whig | 1852-1852, 1858-1859, 1866-1868 | 1852, 1858, 1859, 1866, 1867, 1868 | 6 |
George Hamilton Gordon Earl of Aberdeen | Conservative | 1852-1855 | 1852, 1853, 1854, 1855 | 4 |
Henry John Temple, 3rd Viscount Palmerston | Whig and Liberal | 1855-1858, 1859-1865 | 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865 | 11 |
Benjamin Disraeli, the Earl of Beaconsfield | Conservative | 1868-1868, 1874-1880 | 1868, 1874, 1875, 1876, 1877, 1878, 1879, 1880 | 8 |
William Ewart Gladstone | Liberal | 1868-1874, 1880-1885, 1886-1886, 1892-1894 | 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1892, 1893, 1894 | 17 |
Robert Gascoyne-Cecil, 3rd Marquess of Salisbury | Conservative | 1885-1886, 1886-1892, 1895-1902 | 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902 | 16 |
Archibald Primrose, 5th Earl of Rosebery | Liberal | 1894-1895 | 1894, 1895 | 2 |
Arthur James Balfour | Conservative | 1902-1905 | 1902, 1903, 1904, 1905 | 4 |
Sir Henry Campbell-Bannerman | Liberal | 1905-1908 | 1905, 1906, 1907, 1908 | 4 |
Herbert Henry Asquith | Liberal | 1908-1916 | 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916 | 9 |
David Lloyd George | Liberal | 1916-1922 | 1916, 1917, 1918, 1919, 1920, 1921, 1922 | 7 |
Andrew Bonar Law | Conservative | 1922-1923 | 1922, 1923 | 2 |
Stanley Baldwin | Conservative | 1923-1924, 1924-1929, 1935-1937 | 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1935, 1936, 1937 | 10 |
James Ramsay MacDonald | Labour | 1924-1924, 1929-1935 | 1924, 1929, 1930, 1931, 1932, 1933, 1934, 1935 | 8 |
Neville Chamberlain | Conservative | 1937-1940 | 1937, 1938, 1939, 1940 | 4 |
Sir Winston Churchill | Conservative | 1940-1945, 1951-1955 | 1940, 1941, 1942, 1943, 1944, 1945, 1951, 1952, 1953, 1954, 1955 | 11 |
Clement Attlee | Labour | 1945-1951 | 1945, 1946, 1947, 1948, 1949, 1950, 1951 | 7 |
Sir Anthony Eden | Conservative | 1955-1957 | 1955, 1956, 1957 | 3 |
Harold Macmillan | Conservative | 1957-1963 | 1957, 1958, 1959, 1960, 1961, 1962, 1963 | 7 |
Sir Alec Douglas-Home | Conservative | 1963-1964 | 1963, 1964 | 2 |
Harold Wilson | Labour | 1964-1970, 1974-1976 | 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1974, 1975, 1976 | 10 |
Sir Edward Heath | Conservative | 1970-1974 | 1970, 1971, 1972, 1973, 1974 | 5 |
James Callaghan | Labour | 1976-1979 | 1976, 1977, 1978, 1979 | 4 |
Baroness Margaret Thatcher | Conservative | 1979-1990 | 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990 | 12 |
Sir John Major KG CH | Conservative | 1990-1997 | 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 | 8 |
Sir Tony Blair KG | Labour | 1997-2007 | 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 | 11 |
Gordon Brown | Labour | 2007-2010 | 2007, 2008, 2009, 2010 | 4 |
Lord Cameron | Conservative | 2010-2016 | 2010, 2011, 2012, 2013, 2014, 2015, 2016 | 7 |
Theresa May | Conservative | 2016-2019 | 2016, 2017, 2018, 2019 | 4 |
Boris Johnson | Conservative | 2019-2022 | 2019, 2020, 2021, 2022 | 4 |
Elizabeth Truss | Conservative | 2022-2022 | 2022 | 1 |
The Rt Hon Rishi Sunak | Conservative | 2022-2024 | 2022, 2023, 2024 | 3 |
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.