Malnutrition may manifest as either obesity or undernutrition. Accumulating evidence suggests that the gut microbiota plays an important role in the harvest, storage, and expenditure of energy obtained from the diet. The composition of the gut microbiota has been shown to differ between lean and obese humans and mice; however, the specific roles that individual gut microbes play in energy harvest remain uncertain. The gut microbiota may also influence the development of conditions characterized by chronic low-level inflammation, such as obesity, through systemic exposure to bacterial lipopolysaccharide derived from the gut microbiota. In this review, the role of the gut microbiota in energy harvest and fat storage is explored, as well as differences in the microbiota in obesity and undernutrition.