Background & aims: The response to weight loss depends on the interindividual variability of determinants such as gut microbiota and genetics. The aim of this investigation was to develop an integrative model using microbiota and genetic information to prescribe the most suitable diet for a successful weight loss in individuals with excess of body weight. Methods: A total of 190 Spanish overweight and obese participants were randomly assigned to two hypocaloric diets for 4 months: 61 women and 29 men followed a moderately high protein (MHP) diet, and 72 women and 28 men followed a low fat (LF) diet. Baseline fecal DNA was sequenced and used for the construction of four microbiota subscores associated with the percentage of BMI loss for each diet (MHP and LF) and for each sex. Bootstrapping techniques and multiple linear regression models were used for the selection of families, genera and species included in the subscores. Finally, two total microbiota scores were generated for each sex. Two genetic subscores previously reported to weight loss were used to generate a total genetic score. In an attempt to personalize the weight loss prescription, several linear mixed models that included interaction with diet between microbiota scores and genetic scores for both, men and women, were studied. Results: The microbiota subscore for the women who followed the MHP-diet included Coprococcus, Dorea, Flavonifractor, Ruminococcus albus and Clostridium bolteaea. For LF-diet women, Cytophagaceae, Catabacteriaceae, Flammeovirgaceae, Rhodobacteriaceae, Clostridium-x1vb, Bacteriodes nordiiay, Alistipes senegalensis, Blautia wexlerae and Psedoflavonifractor phocaeensis. For MHP-diet men, Cytophagaceae, Acidaminococcaceae, Marinilabiliaceae, Bacteroidaceae, Fusicatenibacter, Odoribacter and Ruminococcus faecis; and for LF-men, Porphyromanadaceae, Intestinimonas, Bacteroides finegoldii and Clostridium bartlettii. The mixed models with microbiota scores facilitated the selection of diet in 72% of women and in 84% of men. The model including genetic information allows to select the type of diet in 84% and 73%, respectively.