This study investigates the carbon (δ13Corg) and nitrogen (δ15N) isotopic composition of tertiary lignites and coals from six sedimentary basins: Velenje, Mura-Zala, and Zasavje in Slovenia; Sokolov in Czech Republic, Barito in Indonesia; and Istria in Croatia. The aim is to investigate the correlation between the fine detrital (fD) component and δ13C and δ15N in Velenje lignite samples. Additionally, we aim to evaluate the biogeochemical processes of organic substances during their deposition in all analyzed samples, calculate their δ13CCO2 values and compare the analyzed values of δ13C and δ15N to those reported in the literature. Thirty-two samples were analyzed, predominantly from the Velenje ortho-lignite (Pliocene), with additional lignites and coals from the Pannonian to Paleocene epochs for comparison. Carbon isotopic composition (δ13Corg) ranged from -27.9 to -23.6 ‰, and nitrogen isotopic composition (δ15N) ranged from 1.8 to 7.4 ‰. The fine-detrital lithotypes of the Velenje ortho-lignite exhibited the most negative δ13Corg values due to anaerobic bacterial activity in an intramontane alkaline lake environment influenced by the carbonate hinterland. Moreover, gelification processes affected fine-detrital organic matter more than larger wooden pieces. Terbegovci, Hrastnik meta-lignites, and Barito sub-bituminous coal also displayed low δ13Corg values, indicating limited gelification, while variations in the δ15N values suggested differences in mineralization. The Velenje xylitic lithotypes have higher δ15N values, indicating a more intense mineralization under aerobic conditions. Raša ortho-bituminous coal, deposited in a brackish environment, displayed the highest δ13Corg values and a wide range of δ15N values due to fluctuating water tables in a paralic carbonate platform environment. The lowest δ15N value was observed in the Sokolov Basin lignite coal, indicating minimal mineralization and low bacterial activity. The isotopic composition of CO2 in air (δ13Cair), which was calculated using the δ13C values in lignites and coal, ranged from -8.4 to -3.4 ‰, with Velenje lignite displaying the minimum value and Raša coal showing the maximum value. The determined δ13C and δ15N values of the coal and lignite samples in this research fall within the typical range of world coals.