A swing is a way of measuring shifts in voter support and is based on the change in a party's percentage share of the vote at consecutive elections.
The following list does not include by-elections where the same person retained their seat but as a member of a different party, for example, the Clacton by-election in October 2014, which was triggered by the sitting Conservative MP Douglas Carswell when he announced his defection to Ukip, and which was subsequently held by Mr Carswell on a notional swing of 44.1 percentage points.
Here are the biggest by-election swings against a government since December 1981, where the seat changed hands:
Christchurch (July 29 1993): 35.4 percentage point (pp) swing from Conservative to Liberal Democrats
In a contest to fill the seat following the death of the sitting Conservative MP, Liberal Democrat candidate Diana Maddock turned a Tory majority of more than 23,000 into a Lib Dem majority of over 16,000. The Tories regained the seat at the 1997 general election.
North Shropshire (December 16 2021): 34.1pp swing from Conservative to Liberal Democrats
Former Tory MP Owen Paterson won this seat at the 2019 general election with a majority of just under 23,000. Newly-elected Lib Dem MP Helen Morgan has a majority of nearly 6,000.
Dudley West (December 15 1994): 29.1pp swing from Conservative to Labour
This was the first by-election gain by Labour under its new leader Tony Blair. Labour candidate Ian Pearson won a huge majority of more than 20,000, wiping out a Conservative majority at the previous general election of nearly 6,000.
Brent East (September 18 2003): 29.0pp swing from Labour to Liberal Democrats
Lib Dem candidate Sarah Teather became the youngest member of the House of Commons when she won this contest, which took place in the months after the UK had joined the US-led invasion of Iraq. The Lib Dems had finished third in the general election just two years earlier.
Newbury (May 6 1993): 28.4pp swing from Conservative to Liberal Democrats
David Rendel turned a Tory majority of more than 12,000 into a Lib Dem majority of 22,000. It was the first in a string of by-election defeats for the 1992-97 Conservative government led by John Major.
Chesham & Amersham (June 17 2021): 25.2pp swing from Conservative to Liberal Democrats
Sarah Green captured this seat for the Lib Dems earlier this year, following the death of the sitting Conservative MP Dame Cheryl Gillan. The seat had been held by the Tories continuously since its creation in 1974. Ms Green won a majority of more than 8,000, overturning Dame Cheryl's majority of 16,000 at the 2019 general election.