General election 2019: How do government finances work?
In the run-up to the 2019 general election, political parties have been setting out their plans for the country.
Some have been promising to borrow lots of money to fund them. So how does it work when a government wants to borrow, and when does it have to pay it back?
Why does a government borrow money?
The government borrows because it spends more than it receives in revenue, which comes mainly from taxes.
It could, in theory, cover all of its spending from taxes - and in some years that has happened.
But governments have not always been willing to increase taxes enough to cover its spending, partly for political reasons - it would be unpopular with voters.
It's also down to economic reasons - if people have less to spend, it is bad for economic growth and jobs.
How much does the government borrow?
The amount the government borrows to make up the difference between what it spends and what it collects is known as "public sector net borrowing". It's also often referred to as "the deficit".
The government has borrowed £46.3bn so far this financial year, from April to October, according to the Office for National Statistics (ONS).
That's 10% more than the same period in 2018, and equates to about £656 per person in the UK.
The big increase in the deficit after the 2008 financial crash was caused by an increase in government spending, and a fall in how much it was receiving in taxes.
How does the government borrow money?
The government borrows this money in financial markets, by selling bonds.
A bond is a promise to make payments to whoever holds it on certain dates. There is a large payment on the final date - in effect the repayment.
Interest is also paid to whoever owns the bond in the meantime. So it's basically an interest-paying "IOU".
The buyers of these bonds, or "gilts", are mainly financial institutions, like pension funds, investment funds, banks and insurance companies. Private savers also buy some.
The appeal to the investors is that British government bonds are seen as essentially no risk - there is no risk that the money won't be paid. You won't lose your money and you know precisely when and how much the payments will be.
When does it have to be paid back?
It varies a lot.
Some government borrowing has to be repaid in a month, but some lending is for as long as 30 years.
The minimum repayment period is just one day, while some bonds have been issued for 55 years.
What is the difference between the government deficit and debt?
The deficit is the amount by which the government's income falls short of what it spends each year.
It covers most of this gap by borrowing, or sometimes by selling assets like property.
In years when a government spends less than its income, it's known as a surplus.
The deficit is not to be confused with debt, although both are linked.
Debt rises when there is a deficit, and falls in those years when there is a surplus.
Debt is the total amount of money owed by the government that has built up over years.
So it's a much larger sum. The debt owed by the UK government climbed by £32.1bn to £1,798.5bn between October 2018 and 2019, says the ONS.
The government does repay debt on the due date, but usually has to borrow new money anyway.