The 1842 Boston mayoral election saw the election of Whig Party nominee Martin Brimmer. It was held on December 12, 1842. Whig Party incumbent Jonathan Chapman was not a nominee for reelection.
Brimmer was the Whig Party nominee while Sumner was the Democratic Party nominee. The Whigs did well in the coinciding municipal elections.
Sumner had run for mayor in 1839 and for the United States House of Representatives in both 1838 and 1839.