The biosynthesis of cobalamin (vitamin B12) is described, revealing how the concerted action of around 30 enzyme-mediated steps results in the synthesis of one of Nature's most structurally complex 'small molecules'. The plethora of genome sequences has meant that bacteria capable of cobalamin synthesis can be easily identified and their biosynthetic genes compared. Whereas only a few years ago cobalamin synthesis was thought to occur by one of two routes, there are apparently a number of variations on these two pathways, where the major differences seem to be concerned with the process of ring contraction. A comparison of what is currently known about these pathways is presented. Finally, the process of cobalt chelation is discussed and the structure/function of the cobalt chelatase associated with the oxygen-independent pathway (CbiK) is described.