Cyanobacteria capable of fixing dinitrogen exhibit various strategies to protect nitrogenase from inactivation by oxygen. The marine Crocosphaera watsonii WH8501 and the terrestrial Gloeothece sp. PCC6909 are unicellular diazotrophic cyanobacteria that are capable of aerobic nitrogen fixation. These cyanobacteria separate the incompatible processes of oxygenic photosynthesis and nitrogen fixation temporally, confining the latter to the dark. Although these cyanobacteria thrive in fully aerobic environments and can be cultivated diazotrophically under aerobic conditions, the effect of oxygen is not precisely known due to methodological limitations. Here we report the characteristics of nitrogenase activity with respect to well-defined levels of oxygen to which the organisms are exposed, using an online and near real-time acetylene reduction assay combined with sensitive laser-based photoacoustic ethylene detection. The cultures were grown under an alternating 12–12 h light–dark cycle and acetylene reduction was recorded continuously. Acetylene reduction was assayed at 20%, 15%, 10%, 7.5%, 5% and 0% oxygen and at photon flux densities of 30 and 76 μmol m−2 s−1 provided at the same light–dark cycle as during cultivation. Nitrogenase activity was predominantly but not exclusively confined to the dark. At 0% oxygen nitrogenase activity in Gloeothece sp. was not detected during the dark and was shifted completely to the light period, while C. watsonii did not exhibit nitrogenase activity at all. Oxygen concentrations of 15% and higher did not support nitrogenase activity in either of the two cyanobacteria. The highest nitrogenase activities were at 5–7.5% oxygen. The highest nitrogenase activities in C. watsonii and Gloeothece sp. were observed at 29°C. At 31°C and above, nitrogenase activity was not detected in C. watsonii while the same was the case at 41°C and above in Gloeothece sp. The differences in the behaviour of nitrogenase activity in these cyanobacteria are discussed with respect to their presumed physiological strategies to protect nitrogenase from oxygen inactivation and to the environment in which they thrive.