Veins and stockworks of fine-grained (microcrystalline to cryptocrystalline) massive magnesite are common in the ultramafic masses of the ophiolite zone of the Inner Dinarides. Strata-bound deposits of the same kind of magnesite and/or dolomite in Miocene fresh-water basins lie above and beside the ultramafic masses. A carbon and oxygen isotope study of 12 magnesite deposits in Yugoslavia addresses their genesis and bearing on a possible relationship between epigenetic and syngenetic magnesites. All but one of the vein deposits have delta 13 C PDB values between -10 and -15 per mil (the exception, Oshve, has values averaging 3.1ppm), and each deposit has a characteristic value. All sediment-hosted deposits have delta 13 C values between -9 and +5 per mil, again with relatively restricted, characteristic fields for each. The two stockworks analyzed have delta 13 C values ranging from -10.6 to +4.3 per mil, but only one of these has values that coincide with the associated sediment-hosted magnesite deposits. With the exception of the Oshve vein deposit, delta 18 O SMOW values range from approximately 24 to 36 per mil and correlate positively with the delta (super /13) C values (r = 0.90, n = 42). Some of the sediment-hosted magnesite (Bela Stena) and dolomite (Braneshci, Cherenje) deposits were deposited in lakes (assumed temperature of 20 degrees C) with a calculated water delta 18 O value of -2 per mil, suggestive of meteoric water; lower lake temperatures would yield more negative values. Assuming that meteoric water with this delta 18 O value was the mineralizing solution, then a temperature of deposition of approximately 70 degrees C is indicated in those veins not intimately related to dikes.The delta 13 C values of < -10 per mil are perhaps best interpreted as the product of decarboxylation of organic material in Triassic and/or Paleozoic sediments two or three kilometers below the upper surface of the ultramafic bodies, a reaction that takes place at > or = 75 degrees C. The suggested low temperatures are consistent with the monomineralic purity of the vein magnesites. At these low temperatures gravity-driven circulating carbonated meteoric waters would react with harzburgite or serpentinite dissolving magnesium, which precipitates as magnesite on pressure drop as CO 2 escapes. The higher delta 13 C values in certain sediment-hosted and stockwork magnesites indicate the involvement of atmospheric CO 2 and possibly carbonate released to the hydrothermal system during contact metamorphism. This latter process is particularly attractive for the Oshve vein deposit with the unusual delta 18 O and delta 13 C values of 19 and 3.1 per mil, respectively, as this is the one vein which is intimately related to a dacite dike.