Vitamins fall into the class of molecules known as micronutrients, which are molecules that humans require in small quantities to maintain normal cellular function. They don't provide calories, but do assist in a variety of different chemical reactions in the body. Like all biomolecules, vitamins consist mostly of the elements carbon, hydrogen, oxygen and nitrogen, with a few other elements featured occasionally.
Carbon is considered the "backbone element" of the molecules of life. This is because of all the elements on the periodic table, carbon is the one that allows for the greatest potential variety of shapes in resulting molecules and forms the strongest, most stable bonds. As a backbone element, carbon provides a molecule's overall shape and structure but doesn't contribute as significantly to function as other elements do. All vitamins have carbon backbones, Drs. Reginald Garrett and Charles Grisham note in their book "Biochemistry."
Like carbon, hydrogen is a part of a molecule's general shape and structure. Hydrogen is the lightest element, and also the most common by sheer number in the molecules of life. All vitamins have significant quantities of hydrogen in them. Most hydrogen atoms on any given molecule simply provide for the molecule's overall shape rather than participating in chemical reactions, but in some cases, hydrogen is an important part of a vitamin's reactivity. For example, it's hydrogen that's responsible for the acidic nature of vitamin C.
Oxygen and Nitrogen
While oxygen and nitrogen aren't as prevalent in vitamins as carbon and hydrogen, they're nevertheless present -- one or both -- in all vitamins, and contribute significantly to functionality. Oxygen atoms in vitamin C are largely responsible for the molecule's antioxidant properties, while nitrogen atoms in the B-vitamins allow them to participate in regulating metabolism. Some vitamins, including vitamin B-6, contain both nitrogen and oxygen.
Apart from the four elements most common in vitamins, there are several elements that show up only in a few vitamins. For instance, both vitamins B-6 and B-12 contain phosphorus, Drs. Mary Campbell and Shawn Farrell note in their book "Biochemistry." In both cases, the phosphorus is in the form of a phosphate group, common to many biomolecules. Vitamin B-1, also called thiamine, contains sulfur, which has chemical reactivity similar to that of oxygen. One of the most unique elements in a vitamin is cobalt, found in vitamin B-12.