The 1940 City of London by-election was a by-election held on 5 February 1940 for the British House of Commons constituency of City of London, which covered the "Square Mile" which was the United Kingdom's traditional financial district.
The by-election was caused by the resignation of one of the city's two Conservative Party Members of Parliament (MPs) Sir Alan Anderson, who had held the seat since a by-election in 1935.
In accordance with the war-time electoral pact, neither the Labour nor the Liberal parties fielded a candidate. The Conservatives did not defend the seat either, instead supporting the National candidate, Sir Andrew Duncan, who had been brought in from industry to serve as President of the Board of Trade.
There being no other candidates, Duncan was returned unopposed.
Election results.
! scope="col" colspan="2" style="width: 130px"|Party
! scope="col" style="width: 17em"|Candidate
! scope="col" style="width: 5em"|Votes
! scope="col" style="width: 3.5em"|%
! scope="col" style="width: 3.5em"| ;templatestyles src="Template:Tooltip/styles.css" / ;±%
! scope="col" colspan="2" style="width: 130px"|Party
! scope="col" style="width: 17em"|Candidate
! scope="col" style="width: 5em"|Votes
! scope="col" style="width: 3.5em"|%
! scope="col" style="width: 3.5em"| ;templatestyles src="Template:Tooltip/styles.css" / ;±%