Crime has remained low on Mr. de Blasio’s watch, even as he has moved to overhaul police practices despised by Democratic voters. The economy is growing. The administration has pushed through new programs to address the needs of the less fortunate, who are also Mr. de Blasio’s base of support, like universal prekindergarten and a push to build affordable housing. He champions the rights of transgender people, immigrants and low-wage earners. He finds broad support among blacks and majority approval from Hispanics.

“He’s in this sweet spot of being progressive enough to satisfy the progressives, but not so far to the left that people think he’s an unrealistic leader,” said Christina Greer, a professor of political science at Fordham University. As for quality of life in the city, she added, “Things are either status quo as they were under Bloomberg, or not as bad as people said they would be under de Blasio.”

The election of President Trump has also been a boon for the mayor, who staked out a position as a vocal opponent of the new administration early on.

Another factor in the mayor’s favor is that most of the logical Democratic contenders, like Scott M. Stringer, the city comptroller, would have to leave their office to run for mayor. The safer route would suggest waiting until 2021, when Mr. de Blasio would have to leave office because of term limits.

Nonetheless, Mr. Stringer, who has been flirting with a run for months, has publicly clashed with Mr. de Blasio on policy matters such as homelessness, child welfare and policing. The city’s public advocate, Letitia A. James, is still mulling a run, though Representative Hakeem Jeffries of Brooklyn, once considered a possible top contender, has all but ruled one out.

Others have been quietly considering jumping in, including Christine C. Quinn, the former City Council speaker who lost to Mr. de Blasio in 2013, and Daniel R. Garodnick, a Manhattan city councilman who cannot seek re-election this year because of term limits.