More than 8,000 people braved icy temperatures and spent the night in the city's Princes Street Gardens as part of "the world's biggest sleepout".
The Sleep in the Park event was organised by Josh Littlejohn, co-founder of Social Bite, which helps the homeless through cafes, a restaurant and fundraising events.
The charity donated the money to Bethany Christian Trust to fund extra capacity at its winter care shelter.
Speaking as the event unfolded, Mr Littlejohn said: "I'm blown away by the amount of people who have turned out.
"It looks like we're going to have about 8,000 people come and sleep out which is mind-blowing really for a country like Scotland, a small country, to get behind a cause like that.
"That's going to translate to somewhere in the region of between £3 million and £4 million that's going to be raised. It's an absolutely incredible result and I'm really humbled by it."
So far, more than £3.6m has been donated.
Sir Bob Geldof and Scottish Deputy First Minister John Swinney joined in by sleeping out in freezing conditions in the Scottish capital.
John Cleese performed a bedtime story, while Liam Gallagher and Deacon Blue were among the entertainment.
Fundraising is open until Christmas Eve and donations can be made at www.sleepinthepark.co.uk