The worldwide prevalence of obesity has nearly tripled in the past ~50 years. The health risks associated with obesity have reached an alarming stage and have become a significant problem worldwide. The pathophysiology of obesity has been proven to be more complex and involves a combination of both genetic and environmental factors, which regulate food intake and energy expenditure. Recent evidences suggest that that certain types of gut bacteria may be more efficient at extracting energy from food than others, which could potentially lead to increased calorie absorption and weight gain. Additionally, it has been suggested that alterations in the gut microbiota may lead to increased inflammation and development of insulin resistance, both of which are closely linked to obesity and related metabolic disorders. Several studies have suggested that the composition of the microbiota may be influenced by factors such as diet, and that interventions aimed at modifying the microbiota (such as lifestyle modification, metabolic surgery, probiotics) could be useful in the prevention or treatment of obesity. Several studies in animal models and humans are showing how gut microbiota is associated with the onset and progression of metabolic disorders. Moreover, these studies are elucidating how the type of diet and surgical approaches, aimed at weight loss, modulate the abundance and the composition of gut microbiota. In this chapter, we will outline which alterations of gut microbiota are associated with obesity, its role in the development of obesity, and how diet and bariatric surgery can modulate the gut microbiota.