Endoliths are more frequently found in extremely harsh environments, but they can inhabit mesic climate and subterranean habitats as well. Whether they are adapted to life inside rocks or do they seek refuge in this way, remains largely unknown for caves and pits. Consequently, subterranean habitats in limestone areas, were explored: three caves in Serbia (Cerjanska, Petnička and Potpeć) and one pit in Croatia (Keranova Golubinka). Sampling of rock substratum containing endoliths was performed at various distances from the entrance, at sites characterized by a lower level of light intensity. Phototrophs were separated from the rock matrix using 10% hydrochloric acid and analyzed using light microscopy. In general, low diversity of endoliths was observed, but representatives from Cyanobacteria, Chlorophyta and Xanthophyta were found. Cyanobacteria, more precisely coccoid forms (genera Aphanocapsa, Chroococcidiopsis, Gloeocapsa, Gloeocapsopsis, Synechococcus), were dominant. The most interesting cyanobacterial taxon, Leptolyngbya-like taxon, representing a true endolith (euendolith), was found in the Petnička Cave. This taxon and its relation to the substratum, as well as chasmoendolithic community from the Keranova Golubinka Pit, were observed using Scanning electron microscopy (SEM). It was observed that chasmoendoliths inhabit already existing surface rock cracks and fissures, while a true endolith actively bores into the substratum. Non-metric multidimensional scaling (NMDS) was performed to observe the similarity between the sampling sites. Endoliths can grow inside the rocks, making them very successful biodeteriogens, which is not a desirable trait for caves and pits that are characterized by various attractive geomorphological features that need to be preserved. Thus, considering these habitats, more attention should be paid to the endolith community in the future.