Locations and details of all the thousands of ancient hill forts found across the landscapes of Ireland, as well as the UK, have been mapped in an online database for the first time.

A team of researchers, with the help of citizen scientists, has spent five years sifting and recording information on all the hill forts across Ireland, England, Wales, Scotland and the Isle of Man.

They have discovered there are 4,147 such ancient sites, ranging from well-preserved forts to places where only crop marks and remnants show where they once stood.

Information on all the hill forts has been collated onto a website that will be freely accessible to the public, including on their smartphones, so they can discover details of the ancient sites they see in the countryside, the team said.

Professor Ian Ralston from the University of Edinburgh, who co-led the project, said: "Standing on a windswept hill fort with dramatic views across the countryside, you really feel like you're fully immersed in history.

"This research project is all about sharing the stories of the thousands of hill forts across Britain and Ireland in one place that is accessible to the public and researchers."

Professor Gary Lock from the University of Oxford said it was important the online database was freely available to researchers and others, such as heritage managers, and would provide the baseline for future research on hill forts.

He added: "We hope it will encourage people to visit some incredible hill forts that they may never have known were right under their feet."

The research reveals that nearly 40% of all the hill forts across the UK and Ireland are found in Scotland, with 408 hill forts located in the Scottish Borders alone.

In England, Northumberland leads the way with 271 hill forts, while in Ireland, Mayo and Cork each have more than 70 sites.

Powys is the county with the most hill forts in Wales, with 147, and in Northern Ireland, Antrim leads the way, with 15.

Hill forts were mostly built during the Iron Age, with the oldest dating to around 1000 BC and the most recent to 700 AD, and had numerous functions, some of which have not been fully discovered.

Despite the name, not all hill forts are on hills, and not all are forts, the experts said.

Excavations show many were used predominantly as regional gathering spots for festivals and trade, and some are on low-lying land.

The research team from the University of Edinburgh, University of Oxford and University College Cork were funded by the Arts and Humanities Research Council (AHRC) to gather information from "citizen scientists" on hill forts.

Around 100 members of the public collected data about the hill forts they visited, identifying and recording the characteristics of forts, which was then analysed by the team.

The public will also be able to continue contributing to the wiki-style database by uploading their own images and text based on their visits.