The World Justice Project's Rule of Law Index for 2015, published on Tuesday, gave both countries 0.87 out of 1, the highest score received worldwide.
Before the figures were rounded up, Denmark's average was fractionally ahead, however, pushing it ahead of Norway in the ranking.
Norway scored particularly highly in its 'effective enforcement of regulations', ranking second worldwide only to Singapore, a country renowned for its strictly enforced regulations such as its ban on chewing gum.
Norway also scored second worldwide for ‘absence of corruption’, ‘civil justice’, and ‘open government’.
The country's weakest area was ‘order and security’, where it came 17th out of the 102 countries in the ranking.
The Rule of Law index was founded in 2006 by Bill Neukom, who headed Microsoft’s legal department from 1985 until 2002. It claims to be the most comprehensive study of its kind.
Norway was followed closely in this year’s ranking by Sweden, Finland, the Netherlands, and New Zealand.
Even though Norway received top marks in the study, Neukom stressed that "the rule of law can always be strengthened."
“Effective rule of law helps reduce corruption, alleviate poverty, improve public health and education, and protect people from injustices and dangers large and small,” he said in a statement.
The top 10 countries in the WJP Rule of Law Index were:
Story continues below…
6. New Zealand