"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.
For months, the spectre of implosion has hovered over the Socialist party, with commentators talking of a fault-line threatening to split the party in two.
And for months senior party members have teetered and fallen to Emmanuel Macron, the man some believe betrayed the party by quitting the government and running for president.
Now the centrist candidate has claimed one of the biggest scalps of all. A man once seen as Mr Macron's sworn political enemy.
But the support of Manuel Valls, a prime minister to France's most unpopular post-war president, may be a mixed blessing for Emmanuel Macron. While he himself served in President Hollande's government, he has worked hard to present himself as an anti-establishment outsider; a fresh face in French politics.
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.
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.

The 53-year-old was due to have what he described as "simple and straightforward" surgery on Monday to relieve a "tightness of the arteries".
However, after extensive tests Allen was allowed to return home and will take first-team training on Thursday.
Barnet are 12th in the table, two points off the play-off places.
A statement on the club website said tests on Allen's condition are ongoing.
France's ex-Prime Minister Manuel Valls has thrown his weight behind the centrist candidate for the presidency, Emmanuel Macron, and not his own Socialist party's candidate.
[NEXT_CONCEPT]
Barnet manager Martin Allen will take charge of Saturday's League Two match against Crewe after a surgeon decided not to operate on a minor heart issue.