The electronic structure and chemical bonding of vitamin B12 (cyanocobalamin) and B12-derivative (methylcobalamin) are studied by means of X-ray emission (XES) and photoelectron (XPS) spectroscopy. The obtained results are compared with ab initio electronic structure calculations using the orthogonalized linear combination of the atomic orbital method (OLCAO). We show that the chemical bonding in vitamin B12 is characterized by the strong Co-C bond and relatively weak axial Co-N bond. It is further confirmed that the Co-C bond in cyanocobalamin is stronger than that of methylcobalamin resulting in their different biological activity.