There was star power in other major cities. The musicians Jake Bugg and Tom Walker performed and the actress Helen Mirren read to participants in Trafalgar Square in London. Ziggy Marley, Ellie Goulding, Meghan Trainor and Sean Kingston entertained those taking part at the Rose Bowl in Pasadena, Calif.

The sleep out, Mr. Littlejohn emphasized, was “in no way an emulation of actually being homeless.” But, he added, those who spend the night outside would “undoubtedly leave with a different sense of perspective and a heightened sense of compassion.”

There are an estimated 3,900 homeless people living on New York City’s streets. Just how dangerous such a life can be was underscored in October, when four homeless men were bludgeoned to death as they slept on the sidewalks of Chinatown in Manhattan. The accused killer, a 24-year-old man, was homeless himself.

Mr. Littlejohn has set a fund-raising target of $50 million for his event. Half of the money would go to nonprofit groups that deal with homelessness in the communities where the donations come from, like the Coalition for the Homeless in New York.

The other half is to go to charities around the world like UNICEF that help people displaced not only by extreme poverty, but also by armed conflict and natural disasters.

The sleep out will be followed by a political drive led by the Institute of Global Homelessness, an advocacy group with a goal of eliminating unsheltered homelessness in 150 cities and countries by 2030. The group plans to work with governments in different countries to come up with ways of addressing the problem.