Species diversity in sandy grasslands is threatened by decalcification and eutrophication. To determine the most appropriate conditions for red-listed gasteromycete fungi in such grasslands, we investigated their pH preferences in this habitat in southern Sweden. During two winters soil samples were collected from the vicinity of mycelia of these species. Chemical analysis revealed that none of the fungi occurred in sandy habitats with a pH lower than 5, although pH values between 4 and 5 are very common in sandy grasslands in the area. We found niche differentiation within the genus Tulostoma in that two out of four species occurred mainly in soils with high lime content, while one had a broad niche and one occurred mainly in soils low in lime and with a pH below 7.5. Also in the genus Geastrum, some species occurred at high lime content, while most Geastrum as well as two Disciseda species preferred soils with only low amounts of lime. We conclude that many species prefer areas with neutral to slightly acid soil. The results were compared with data for key plant species collected in a previous study of calcareous sandy grasslands and this showed that these in general had a wider pH range than the studied fungi. The results highlight the importance of varying pH levels in protected areas and that the transition zone between lime-containing topsoil and complete decalcification is a preferred environment for many red-listed fungi as well as plants.