Stephen O'Brien told reporters during a visit to Damascus that the targeting of non-combatants in the country's war was "unlawful, unacceptable and must stop".
He was "particularly appalled" by government air strikes on a rebel-held suburb of the capital on Sunday.
Activists said on Monday that the death toll from the attack on a market in Douma had risen to at least 96.
That would make it one of the bloodiest single incidents of the four-year-long conflict, which has so far left more than 250,000 people dead.
Meanwhile, the UN Security Council has backed a new peace talks proposal from the organisation's Syria envoy, Staffan de Mistura, in a rare show of unity on a topic that has divided members.
Mr de Mistura's plan involves inviting the various Syrian parties to hold talks at working groups in September, as a step towards implementing the roadmap to peace adopted by world powers in 2012 that calls for the formation of a transitional government
A Syrian military source told the Reuters news agency that in its strikes on Sunday the air force had targeted the headquarters of the rebel group, Jaysh al-Islam (Army of Islam).
State television also reported that rebels had shelled a government-held district of the northern city of Aleppo on Monday, killing 10 people and wounding 17.
Mr O'Brien called on both sides to protect civilians and respect international humanitarian law at the end of a three-day visit to Syria, his first to the country since becoming the UN's under-secretary general for humanitarian affairs in May.
"I am absolutely horrified by the total disregard for civilian life by all parties in this conflict," he said. "Attacks on civilians are unlawful, unacceptable and must stop."
The Syrian Observatory for Human Rights, a UK-based group that monitors the conflict, said that in Sunday's raid on Douma air force jets fired at least 10 rockets at the town's central market before attacking again after rescue workers arrived.
One video said to be of the aftermath showed a marketplace completely destroyed with surrounding buildings in ruins and vehicles on fire.
Turkey has said it plans to set up a "safe zone" for civilians across its border with Syria - policed by "moderate" Syrian forces - who would thwart attacks by the government or Islamic State militants.
But Mr O'Brien questioned the use of such buffer areas, saying any country which established them would have to "accept responsibility" for guaranteeing people's safety.
"Otherwise very vulnerable people could flock to such safe zones only to find that they've put themselves in more harm's way," he told the BBC.
A report by Amnesty International published last week accused the Syrian government of committing war crimes against the 163,000 people living under siege in Douma and other towns in the Eastern Ghouta agricultural belt around Damascus.
Between January and June 2015, government forces carried out at least 60 aerial attacks on the area, killing some 500 civilians, the report said.
The international community has also strongly condemned the air raids.
Mr O'Brien also condemned rival armed groups for cutting off the water supply in Damascus and Aleppo in recent days, affecting at least seven million people.
"It is unacceptable for those engaged in conflict to use access to water and other services as a weapon of war," he said.
The British diplomat noted that the UN and its partners were providing assistance to millions of Syrians in need, but he added: "I remain extremely concerned for the welfare of the 4.6 million people stuck in hard-to-reach and besieged areas."
He also expressed concern at the lack of funding for the humanitarian operation in Syria and its neighbours, which is less than 30% funded.
The UN's humanitarian chief has said he is "horrified" by the attacks on civilians taking place in Syria.