A study of the stable isotope composition (d18O, d13C) of biogenic (ostracod, mollusc) and authigenic carbonates in the Ballagan Formation, Lower Carboniferous of Scotland, coupled with evidence from sedimentology and associated fossil fauna and flora, supports the argument that this formation was deposited in a coastal flood plain setting, in brackish (0.5 < 30‰ NaCl) and hypersaline (> 40‰ NaCl) waters, but in the absence of persistent normal marine conditions. The oxygen isotope data from the Ballagan Formation divide into three clusters: a diagenetic field defined by low d18O (< - 11‰ VPDB); an intermediary field (d18O - 11‰ to - 9‰) composed of a mixture of known primary and secondary (diagenetic) carbonates; and samples within the range of - 9‰ to - 4‰ which, as far as we can ascertain, are largely unaltered. No samples give typical Early Carboniferous d18O marine values. Average marine carbonates from Europe have d18O between - 4‰ to - 3‰. The Ballagan Formation carbonates were probably deposited in evaporated freshwater and/or brackish water. This conclusion is supported by the presence of evaporites (gypsum, anhydrite, halite pseudomorphs) and common desiccation-cracked mudstone surfaces throughout the Ballagan Formation, suggesting conditions of fluctuating salinity in ephemeral bodies of water. The stable isotope data support the notion that the ostracod assemblages of the Ballagan Formation were colonising brackish water and hypersaline ecologies on a coastal flood plain during the Early Carboniferous, a stage of development that may have encouraged their colonisation of fully non-marine (limnetic) environments during the later Carboniferous. The ostracods include cytherellacean and kloedenellacean species known from marginal marine sites elsewhere, but probably tolerant of brackish water, podocopid species such as 'Bythocypris' aequalis that may have been adapted for brackish water settings on coastal flood plains (ephemeral lakes and lagoons), and paraparchitacean- dominated assemblages that may signal harsh (hypersaline or desiccating) environments.