"It's a question of reason," he said on French TV.
His decision prompted immediate thanks from Mr Macron, who is neck-and-neck for the first round of the election with far-right leader Marine Le Pen.
Mr Valls was himself defeated in the race for the Socialist candidacy.
But instead of backing the man who won, Benoît Hamon, the former prime minister announced on Wednesday that backing Mr Macron was the responsible position to take, because of the risk of giving the presidency to the right or far right.
"I don't think you take risks for the Republic. So I will vote for Emmanuel Macron," he said. "France's best interests go beyond the rules of a primary."
Mr Valls met Socialist MPs on Tuesday night to explain his position, and he has rejected accusations of betraying his own party. Mr Hamon has already accused party heavyweights of stabbing him in the back and said on Wednesday that he was the victim of a weekly soap opera aimed at undermining him.
While not the first senior party figure to back Emmanuel Macron, Mr Valls is seen as the biggest name so far. Defence Minister Yves Le Drian and a handful of junior ministers have already given the centrist their support.
Benoît Hamon has accused Socialist defectors of stabbing him in the back
Mr Macron served as economy minister in Mr Valls's Socialist government but left to fight for the presidency with his own movement En Marche! (On the move). Opinions polls suggest he will qualify for the second round run-off against Ms Le Pen in May.
Benoît Hamon, seen as a left-wing rebel within the party, has failed to attract mainstream support across the French left and his campaign has been eclipsed by radical left candidate Jean-Luc Mélenchon, who could beat him into fifth place in the first-round vote on 23 April.
Mr and Mrs Filon are both under formal investigation over "faje work" allegations
Centre-right candidate François Fillon, initially tipped to win the race, has fallen behind the two front-runners because of "fake job" allegations surrounding his British-born wife, Penelope.
Both have been placed under formal investigation over the claims that she did little work for the hundreds of thousands of euros she received in public funds as parliamentary assistant.