Rock-inhabiting fungi are the groups of fungi that slow-growing, have highly melanized cell walls, have meristematic development, or produce yeast-like. Normally, these fungi were studied and discovered in temperate and polar zones, especially in Europe and Antarctica. This area of research remained limited in Asia, with the majority of studies originating from China. Notably, absent from prior reports were rock-inhabiting fungi in Thailand. In this study, we aim to investigate the diversity of rock-inhabiting fungi in northern Thailand as well as exploring the potential applications of melanin synthesis derived from these fungi. Herein, rock samples were collected in Chiang Mai, Lampang, Lamphun, and Sukhothai Provinces, Thailand. Fifty-eight fungal strains were obtained and initially identified based on morphological characteristics and the internal transcribed spacer (ITS) data. These fungal strains were found to belong to three main classes Dothideomycetes, Eurotiomycetes, and Sordariomycetes. Forty-seven strains have potential for new taxa. Four new Exophiala species (18 strains), namely Exophiala lamphunensis, E. lapidea, E. saxicola, and E. siamensis have been introduced. Nevertheless, the remaining 29 strains were identified for further study. Furthermore, all of these fungal strains were investigated for the potential for melanin production. The findings showed that all of 58 fungal strains could produce melanin. Aureobasidium melanogenum strain LPN6-72 showed the highest potential for melanin production, followed by an unrecognized taxa strain CMU2-1. Inhibition studies involving specific inhibitors suggest that A. melanogenum could be synthesized melanin through the DHN pathway. However, strain CMU2-1 could synthesize melanin via both DOPA and DHN pathways.