The mayor of New York City is the chief executive of the Government of New York City, as stipulated by New York City's charter. The current officeholder, the 112th in the sequence of regular mayors, is Zohran Mamdani, a member of the Democratic Party.

During the Dutch colonial period from 1624 to 1664, New Amsterdam was governed by the Director of New Netherland. Following the 1664 creation of the British Province of New York, newly renamed New York City was run by the British military governor, Richard Nicolls. The office of Mayor of New York City was established in 1665. Holders were appointed by colonial governors, beginning with Thomas Willett. The position remained appointed until 1777. That year, during the American Revolution, a Council of Appointment was formed by the State of New York. In 1821 the New York City Council – then known as the Common Council – began appointing mayors. Since 1834, mayors have been elected by direct popular vote.

The city included little beyond the island of Manhattan before 1874, when it annexed the western part of the Bronx, to be followed in 1895 by the rest of the Bronx. The 1898 consolidation created the city as it is today with five boroughs: Queens, Brooklyn, Manhattan, Staten Island and the Bronx. The first mayor of the expanded city was Robert Anderson Van Wyck.

The longest-serving mayors have been Fiorello La Guardia (1934–1945), Robert F. Wagner Jr. (1954–1965), Ed Koch (1978–1989) and Michael Bloomberg (2002–2013), each of whom was in office for twelve years (three successive four-year terms). The shortest terms in office since 1834 have been those of acting mayors: William T. Collins served a single day on December 31, 1925, Samuel B. H. Vance served one month (from November 30 to December 31, 1874), and Thomas Coman served five weeks (from November 30, 1868, to January 4, 1869).

Colonial mayors (1665–1783) Before 1680, mayors served one-year terms. From 1680, they served two-year terms.

NameTermPrevious office 1 Thomas Willett 1665–1666 Captain of the Plymouth Colony militia 2 Thomas Delavall 1666–1667 Receiver-General of New York City 3 Thomas Willett 1667–1668 4 Cornelius Steenwyk 1668–1671 5 Thomas Delavall 1671–1672 2nd Mayor of New York City 6 Matthias Nicoll 1672–1673 7 John Lawrence 1673–1674 8 Matthias Nicoll 1674–1675 6th Mayor of New York City 9 William Dervall 1675–1676 10 Nicholas De Mayer 1676–1677 11 Stephanus van Cortlandt 1677–1678 12 Thomas Delavall 1678–1679 2nd & 5th Mayor of New York City 13 Francis Rombouts 1679–1680 14 William Dyre 1680–1682 15 Cornelius Steenwyk 1682–1684 Governor of New Holland 16 Gabriel Minvielle 1684–1685 17 Nicholas Bayard 1685–1686 Member of the New York Executive Council 18 Stephanus van Cortlandt 1686–1688 11th Mayor of New York City 19 Peter Delanoy 1689–1691 20 John Lawrence 1691 7th Mayor of New York City 21 Abraham de Peyster 1691–1694 22 Charles Lodwick 1694–1695 Captain of the New York City militia 23 William Merritt 1695–1698 24 Johannes de Peyster 1698–1699 Assistant alderman of the New York CityCommon Council 25 David Provost 1699–1700 26 Isaac De Riemer 1700–1701 Alderman of the New York CityCommon Council from the West Ward 27 Thomas Noell 1701–1702 28 Phillip French 1702–1703 Alderman of the New York CityCommon Council 29 William Peartree 1703–1707 30 Ebenezer Wilson 1707–1710 Sheriff of New York County 31 Jacobus van Cortlandt 1710–1711 32 Caleb Heathcote 1711–1713 33 John Johnstone 1714–1719 Member of the New Jersey General Assemblyfrom Perth Amboy 34 Jacobus van Cortlandt 1719–1720 31st Mayor of New York City 35 Robert Walters 1720–1725 Associate justice of the New YorkSupreme Court of Judicature 36 Johannes Jansen 1725–1726 Member of the New York General Assembly 37 Robert Lurting 1726–1735 38 Paul Richard 1735–1739 39 John Cruger 1739–1744 Alderman of the New York CityCommon Council from the Dock Ward 40 Stephen Bayard 1744–1747 41 Edward Holland 1747–1756 23rd Mayor of Albany 42 John Cruger Jr. 1757–1766 43 Whitehead Hicks 1766–1776 Associate justice of the New YorkSupreme Court of Judicature 44 David Mathews 1776–1783 Clerk of Orange County

Pre-consolidation mayors (1784–1897) The mayor continued to be selected by the Government of New York's Council of Appointment until 1821, when Stephen Allen became the first mayor appointed by the New York City Common Council. Under the Charter of 1834, mayors were elected annually by direct popular vote. Starting in 1849, mayors were elected to serve two-year terms.

PortraitNameTermPartyElectionPrevious office 45 James Duane January 1, 1784–1789 Unaffiliated – Member of the Congress of the Confederation from New York 46 Richard Varick October 12, 1789–December 31, 1801 Federalist – 2nd Attorney General of New York 47 Edward Livingston 1801–1803 Democratic-Republican – Member of the U.S. House of Representatives from New York's 2nd district 48 DeWitt Clinton 1803–1807 Democratic-Republican – United States Senator from New York 49 Marinus Willett 1807–1808 Democratic-Republican – Sheriff of New York County 50 DeWitt Clinton 1808–1810 Democratic-Republican – 48th Mayor of New York City 51 Jacob Radcliff February 13, 1810–1811 Federalist – Justice of the New York Supreme Court 52 DeWitt Clinton 1811–1815 Democratic-Republican – 48th & 50th Mayor of New York City 53 John Ferguson March 6, 1815–July 9, 1815 Democratic-Republican – Naval officer of the Port of New York 54 Jacob Radcliff July 10, 1815–1818 Federalist – 51st Mayor of New York City 55 Cadwallader D. Colden 1818–1821 Federalist – Member of the New York State Assembly from the 1st district 56 Stephen Allen 1821–1824 Federalist – Assistant alderman of the New York City Common Council from the 10th ward 57 William Paulding Jr. 1825–1826 Unaffiliated – Member of the U.S. House of Representatives from New York's 2nd district 58 Philip Hone 1826–1827 Federalist – Member of the New York City Board of Assistant Aldermen from the 3rd ward 59 William Paulding Jr. 1827–1829 Unaffiliated – 57th Mayor of New York City 60 Walter Bowne 1829–1833 Democratic – Member of the New York State Senate from the 1st district 61 Gideon Lee 1833–1834 Democratic – Member of the New York City Board of Aldermen 62 Cornelius Lawrence 1834–1837 Democratic 183418351836 Member of the U.S. House of Representatives from New York's 3rd district 63 Aaron Clark 1837–1839 Whig 18371838 Member of the New York City Board of Aldermen from the 1st ward 64 Isaac L. Varian 1839–1841 Democratic 18391840 Member of the New York State Assembly from New York County 65 Robert H. Morris 1841–1844 Democratic 184118421843 18th Recorder of New York City 66 James Harper 1844–1845 American Republican 1844 Partner at Harper & Brothers 67 William Frederick Havemeyer 1845–1846 Democratic 1845 Presidential elector from New York 68 Andrew H. Mickle 1846–1847 Democratic 1846 New York City public school trustee from the 1st ward 69 William V. Brady 1847–1848 Whig 1847 Member of the New York City Board of Aldermen 70 William Frederick Havemeyer 1848–1849 Democratic 1848 67th Mayor of New York City 71 Caleb Smith Woodhull 1849–1851 Whig 1849 President of the New York City Board of Aldermen 72 Ambrose Kingsland 1851–1853 Whig 1850 Commissioner of the Croton Aqueduct 73 Jacob Aaron Westervelt 1853–1855 Democratic 1852 Member of the New York City Board of Aldermen from the 13th ward 74 Fernando Wood January 1, 1855–December 31, 1857 Democratic 18541856 Member of the U.S. House of Representatives from New York's 3rd district 75 Daniel F. Tiemann January 1, 1858–December 31, 1859 Unaffiliated 1857 Member of the Board of Governors of the New York City Alms House 76 Fernando Wood January 1, 1860–December 31, 1861 Democratic 1859 74th Mayor of New York City 77 George Opdyke 1862–1864 Republican 1861 Member of the New York State Assembly from the 14th district 78 Charles Godfrey Gunther 1864–1866 Democratic 1863 President of the Board of Governors of the New York City Alms House 79 John T. Hoffman January 1, 1866–November 30, 1868 Democratic 18651867 25th Recorder of New York City Acting Thomas Coman November 30, 1868–January 4, 1869 Democratic – President of the New York City Board of Aldermen 80 A. Oakey Hall January 4, 1869–December 31, 1872 Democratic 18681870 District Attorney of New York County 81 William Frederick Havemeyer January 1, 1873–November 30, 1874 Republican 1872 President of the Bank of North America Acting Samuel B. H. Vance November 30, 1874–December 31, 1874 Republican – President of the New York City Board of Aldermen 82 William H. Wickham January 1, 1875–December 31, 1876 Democratic 1874 President of the New York City Fire Department 83 Smith Ely Jr. January 1, 1877–December 31, 1878 Democratic 1876 Member of the U.S. House of Representatives from New York's 7th district 84 Edward Cooper January 1, 1879–December 31, 1880 Democratic 1878 Member of the Commission to Devise a Plan for the Government of Cities in the State of New York 85 William Russell Grace January 1, 1881–December 31, 1882 Democratic 1880 President of W. R. Grace & Co. 86 Franklin Edson January 1, 1883–December 31, 1884 Democratic 1882 President of the New York Produce Exchange 87 William Russell Grace January 1, 1885–December 31, 1886 Unaffiliated 1884 President of W. R. Grace & Co. 88 Abram Hewitt January 1, 1887–December 31, 1888 Democratic 1886 Member of the U.S. House of Representatives from New York's 10th district 89 Hugh J. Grant January 1, 1889–December 31, 1892 Democratic 18881890 Sheriff of New York County 90 Thomas Francis Gilroy January 1, 1893–December 31, 1894 Democratic 1892 Undersheriff of New York County 91 William Lafayette StrongJanuary 1, 1895–December 31, 1897 Republican 1894 President of the First National Bank

Post-consolidation mayors (since 1897) The first post-consolidation mayoral term was four years long. The New York City Charter was revised to make the mayor's term two-years in length beginning in 1902, but after two such terms was reverted to four-year terms in 1906. George B. McClellan Jr. thus served one two-year term from 1904 to 1905, during which he was elected to a four-year term from 1906 to 1909. Since then, mayors have had to be elected with the support of all five boroughs: Queens, Brooklyn, Manhattan, Staten Island, and the Bronx.

The party of the mayor reflects party registration, as opposed to the party lines run under during the general election.