Farts typically have an unpleasant odor due to the presence of sulfur compounds, such as hydrogen sulfide and methane. These compounds are produced during the digestion process when bacteria in the intestines break down food.