Timeline of prime ministers of Great Britain and the United Kingdom

This is a graphical timeline of prime ministers of Great Britain and the United Kingdom from when the first prime minister of Great Britain in the modern sense, Robert Walpole, took office in 1721, until the present day.

From 1801 until 1922, British prime ministers also held the office for the whole of Ireland.

Great Britain

United Kingdom of Great Britain and Ireland

United Kingdom of Great Britain and Northern Ireland

Combined timeline

Career-based timeline
This timeline shows most of the early life, the political career and death of each prime minister of the United Kingdom from 1846.  The first prime minister was Robert Walpole in the early 18th century .

Unlike countries where the leader is elected directly to the highest political office of a separate executive, the prime minister must first establish a political career in the UK Parliament and typically serves many years in the House of Commons before becoming Prime Minister, and in some cases for many years afterwards.

Since the Marquess of Salisbury in 1895, all time in parliamentary service before being Prime Minister has been in the House of Commons, apart from Sir Alec Douglas-Home's period as a member of the Government while in the House of Lords (1951–63; though he was previously the elected member for Lanark, 1931–1945).  After becoming Prime Minister, Douglas-Home returned to the Commons by winning a by-election on the recess death of MP Gilmour Leburn.

Key
 Each dark coloured bar denotes the time spent as Prime Minister
 A light colour denotes time spent in Parliament before or after serving as Prime Minister
 A grey colour bar denotes the time the prime minister spent outside the House of Commons or the entire Parliament, either before or after their political career

Notable moments since 1800
 two separate periods in office: Russell, Palmerston, Disraeli, MacDonald, Churchill, Wilson
 three separate periods in office: Derby, Salisbury, Baldwin
 four separate periods in office: Gladstone
 crossed the floor: Palmerston, Derby, Gladstone, Churchill (twice)
 died in office: Canning, Palmerston, Perceval (assassinated)
 died less than six months after leaving office: Portland, Campbell-Bannerman, Law, Chamberlain
 left Parliament on leaving office: Russell, Baldwin, Blair
 lived for more than twenty years after leaving the House of Commons: Macmillan, Douglas-Home, Thatcher, Major
 less than twenty years in Parliament before being Prime Minister: Baldwin, Chamberlain, Wilson, Major, Blair, Cameron, May, Johnson, Truss, Sunak
 more than twenty years in Parliament after being Prime Minister: Rosebery, Balfour, Lloyd George, Heath
 served as Prime Minister after an interruption to their parliamentary career: MacDonald, Churchill, Macmillan (twice), Douglas-Home, Johnson 
 served as Prime Minister for two monarchs: Walpole, Newcastle, Liverpool, Wellington, Melbourne, Salisbury, Asquith, Churchill, Truss
 served as Prime Minister for three monarchs: Baldwin
 served as Prime Minister for less than two months: Truss
 feature in two of the lists above: Russell, Derby, Gladstone, MacDonald, Wilson, Palmerston, Blair, Cameron, Johnson, Truss
 feature in three of the lists above: Baldwin, Churchill
 feature in four of the lists above: Baldwin, Churchill

Timeline

References
 

Prime Ministers
Timeline
Prime Ministers of the United Kingdom