Terahertz time-domain spectroscopy has been used to measure the absorption spectra and the indexes of refraction of vitamin B1, B2, B6 and B12, which are vital to human beings. Experimentally, from comparison, it is found that they have different fingerprint spectra. Theoretically, the molecule structure of the samples are optimized using density functional theory (DFT) and then these frequencies are calculated. The optimized molecular structure and vibration frequencies of three kinds of the samples are obtained; the results are in agreement with simulation. The simulation results show that most of the vibration frequencies are caused by the torsion and wagging of the molecular, others are caused by intermolecular or phonon mode. This study not only provides better theoretical and experimental methods, but also be helpful to the detection of vitamins with spectra.