The fourth World Happiness Report also found that countries where there was less inequality were happier overall.
Switzerland, Iceland, Norway and Finland, which like Denmark have strong social security systems, made up the rest of the top five.
The US was the world's 13th happiest country, the UK was 23rd, China was 83rd and India was 118th.
Why are the Danes so happy?
Hygge: The Danish concept for happy homes
At the bottom of the 156 countries on the list was Burundi, which is experiencing severe political unrest and the threat of violence. It scored worse than Syria, where a civil war has killed more than 250,000 people over the past five years.
The survey found Syrians had a better healthy-life expectancy and were also seen as being more generous than Burundians and people in the three other nations - Togo, Afghanistan and Benin - making up the five least happy countries.
Northern America, Latin America and the Caribbean and Europe were the happiest regions overall.
South Asia and sub-Saharan Africa were the only regions where the average rating for wellbeing was less than five out of 10.
The report - compiled by the UN's Sustainable Development Solutions Network (SDSN) - is an analysis of Gallup World Poll data generated from surveys of 1,000 people in each country every year for three years. They were asked to evaluate their lives on a ladder scale of zero to 10.
The researchers defined six key categories:  gross domestic product (a nation's output of goods and services) per capita, social support, healthy-life expectancy, personal freedom, charitable giving and perceived corruption.
The report found that people are happier living in societies where there is less inequality of happiness. Likewise it found that the bigger the gap - or inequality - in a country's happiness, the more widespread unhappiness is as a whole.
It also looked at social support - defined as being able to count on someone in difficult times - and the presence or otherwise of corruption.
"Human wellbeing should be nurtured through a holistic approach that combines economic, social and environmental objectives," Columbia University Earth Institute Director Jeffrey Sachs said in a SDSN press release.
"Rather than taking a narrow approach focused solely on economic growth, we should promote societies that are prosperous, just, and environmentally sustainable."
Denmark is the world's happiest country while Burundi is the least happy, according to a new survey.