Bacteria have various nutritional requirements that can be classified in several ways. They require a source of energy, usually from chemical reactions or light. They also require electrons, which can come from inorganic or organic compounds. Bacteria are categorized based on their carbon source, whether they can produce their own carbon through photosynthesis or must obtain it from organic matter. They need nitrogen, usually from ammonia, nitrates or nitrogen-fixing bacteria. Minerals like sulfur, phosphorus, oxygen and trace elements are required. Vitamins may be synthesized or obtained from the environment. Water is also essential, making up most of the bacterial cell volume.