President Biden has nearly erased Donald J. Trump’s early polling advantage, amid signs that the Democratic base has begun to coalesce behind the president despite lingering doubts about the direction of the country, the economy and his age, according to a new survey by The New York Times and Siena College.

Mr. Biden and Mr. Trump are now virtually tied, with Mr. Trump holding a 46 percent to 45 percent edge. That is an improvement for Mr. Biden from late February, when Mr. Trump had a sturdier 48 percent to 43 percent lead just before he became the presumptive Republican nominee.

Mr. Biden’s tick upward appears to stem largely from his improved standing among traditional Democratic voters — he is winning a greater share of voters who supported him in 2020 than he did a month ago. Then, Mr. Trump had secured the support of far more of his past voters compared with the president — 97 percent to 83 percent — but that margin has narrowed. Mr. Biden is now winning 89 percent of his 2020 supporters compared with 94 percent for Mr. Trump.

The tightening poll results are the latest evidence of a 2024 contest that both campaigns are preparing to be excruciatingly close. The last two presidential elections were decided by tens of thousands of votes in a handful of battleground states, and this one could be just as tight. In a nation so evenly divided, even the tiniest of shifts in support could prove decisive.

Beneath the narrowing contest, many of the fundamentals of the race appear largely unchanged.

The share of voters who view the nation as headed in the wrong direction remains a high 64 percent. Almost 80 percent of voters still rate the nation’s economic conditions as fair or poor, including a majority of Democrats. And both Mr. Biden and Mr. Trump remain unpopular, for familiar reasons. Most voters think Mr. Biden is too old. A majority believe Mr. Trump has committed serious federal crimes.

“Just blah,” said Beth Prevost, a 59-year-old hairdresser and independent voter in Windsor Locks, Conn., summing up the feelings of so many about the rematch. She said she was leaning toward Mr. Biden as “the lesser of the two evils.”