Hedgehogs are listed as vulnerable to extinction in the UK, with populations falling, particularly in rural areas, due to habitat loss, intensive farming and death on roads.
Lead researcher, Kelly Hitchcock, of Nottingham Trent University and Chester Zoo, said: "The pattern that we've seen is that hedgehog populations in rural areas have declined – gardens seem like a really important habitat – so it's really important that people are aware of that."
The researchers analysed thousands of images from 415 gardens, alongside each garden's specific characteristics, to examine how often hedgehogs were detected and which features most influenced them stopping by.
Leaving food out was the biggest factor, but the experts say providing wildlife friendly features is essential too as hedgehogs struggle to find space to hibernate and breed.
These include patches of wildflowers, native plants, leaf litter and log piles, and holes in fences so hedgehogs can roam over large areas.
If you are providing wildlife food, be mindful of what that food is and whether it's suitable for hedgehogs, said Hitchcock.
"It's not that we want to say everybody feed hedgehogs because we don't know the long-term impacts," she added.