Hamburg is the world’s best city for a night out, according to a survey exploring how local residents feel about nightlife in their hometown. Londoners, however, are far less enamoured with their city’s after-dark experience: the UK capital made it to just number 26 on the list.

The survey, commissioned by Hostelworld, consisted of 4,100 interviews with residents in 41 cities around the world. It asked residents to rate the nightlife in their hometown based on five categories: Quality, openness and friendliness of the locals, ease of travel, safety and cost.

Hamburg came first overall, getting the highest score for both openness and friendliness and ease of getting around. The city’s nightlife scene has a strong mix of underground clubbing, classy cocktail bars and cheap drinking venues, with the St Pauli district attracting thousands of people for a night out each weekend. (The port city also has great food and top culture in the form of museums and the Elbphilharmonie.)

Copenhagen came second, scoring highest when it came to safety but missing out on the top spot because of high costs. The city’s redeveloped meatpacking district in Vesterbro has become the most popular neighbourhood for nightlife, with lots of bars and clubs within walking distance of each other in spaces left by former meat businesses. A beer, however, costs an average of Dh24 – expensive by European standards.

Berlin came third overall, with locals being the most happy when it comes to the price of partying. The city’s nightlife is famously low-cost: a beer can cost around Dh12 and entry to even the biggest clubs is rarely more than Dh50-60 for hours of partying.

Residents of London were far more critical of their city’s nightlife, coming bottom when it came to affordability. The category where London performs best is ‘openness and friendliness’, where it came 19th. The city ranked 22nd for quality of nightlife, 26th for getting around and 28th for sense of safety.

The top ten cities, as collected in a survey carried out in October 2017, are: Hamburg, Germany; Copenhagen, Denmark; Berlin, Germany; Dublin, Ireland; Amsterdam, Netherlands; San Francisco, US; Gothenburg, Sweden; Prague, Czech Republic; Warsaw, Poland; New York, US.

Guardian News & Media Ltd, 2017