The hybrid density functional B3LYP is used to describe the bonding of the diatomic molecules O(2), NO and CO to ferrous heme. Three different models are used, a five-coordinated porphyrin in benzene, the myoglobin active site including the distal histidine and the binuclear center in cytochrome oxidase. The geometric and electronic structures are well described by the B3LYP functional, while experimental binding energies are more difficult to reproduce. It is found that the Cu(B) center in cytochrome oxidase has a similar effect on the binding of the diatomics as the distal histidine in myoglobin.