Debt is the amount of money owed by the government. The deficit is how much more the government spends than it brings in through things like taxes (it's basically what's added to the debt each year).
The best way to measure the debt and deficit is as a percentage of the size of the economy (GDP).
In general, most of the period since the Second World War has seen the UK debt fall as a percentage of the size of the economy (GDP)t. The most significant change happened after the financial crisis of 2008 when the debt and deficit levels increased under Labour, partly because Labour spent more and partly because the economy shrank. Since the Conservatives took office in 2010, first in coalition with the Lib Dems and then alone, the deficit has fallen back to 1% of GDP while debt has grown.
The year before Labour came to power in 1997, the deficit was 3% of GDP and the debt was 37% of GDP. Labour's first few term saw both measures fall, while during Labour's second and third terms they returned to pretty much their state in 1996/97.
Then the onset of the financial crisis saw debt and deficit increase dramatically. The deficit increased from nearly 3% of GDP in 2007/08 to 10% in 2009/10 - a peacetime high. The debt increased from 34% of GDP to 63% of GDP.
Since 2010 under the coalition and Conservative governments, the deficit has fallen considerably and is expected to be 1.3% of GDP this year (2019/20). However debt has continued to increase from 63% of GDP in 2009/10 and is expected to be over 82% this year.
Going back further
During the Second World War the country took on a massive amount of debt to pay for the war effort. Debt peaked at nearly 260% of GDP in 1946/47.
From 1947 to 1990, under Labour and Conservative governments, the debt as a share of GDP slowly came down as the economy grew. Over this period the deficit ebbed and flowed.
The debt reached a peacetime low in 1990/91 at under 22% of GDP. During Margaret Thatcher's final years as Prime Minister and John Major's term debt and deficit ticked back up, partly in response to the early 1990s financial crisis.
As mentioned, Labour under Tony Blair initially reduced the debt and actually ran a surplus for a few years (the opposite of a deficit where the government is essentially profit-making), before increasing spending.
The scale of the financial crisis means it's a bit simplistic to compare the public finance records of the last two governments to previous governments.
You can explore the figures for yourself here.
This article is part of our Ask Full Fact series on the 2019 general election, answering your questions about the election, from claims the main parties are making to what happens on polling day.
You can see all the questions we’ve answered so far and we’ll keep adding to it as we get through them.