In the last years, epigenetics is helping to explain the mechanisms non dependent on the genetic sequence by which the nutrients and other environmental factors contribute to modulate gene expression and disease development. Obesity and type 2 diabetes are two diseases that have been linked to changes in epigenetic marks (particularly DNA methylation, covalent modifications of histones and miRNAs). These epigenetic changes appear to be influenced, mainly in the perinatal period but also in adulthood, by environmental factors such as hyperglycemia or the diet. Among the food compounds that have been linked to epigenetic modifications, there are methyl donor groups, excessive or deficient caloric intake, short chain fatty acids, some minerals and antioxidant vitamins, and various compounds of plant origin, as catechins, isoflavones or isothiocyanates. EWAS studies, that analyze the methylation of thousands of CpG sites in thousands of individuals, will contribute in the next years to identify some of the epigenetic marks that can be used as early predictors of metabolic risk, as well as some intimate mechanisms that explain the development of obesity, type 2 diabetes and its complications. Moreover, epigenetic marks, among them the CpG-SNPs, can be heritable but some of them could be potentially reversible. One of the medium-term objectives is to develop drug or diet-related treatments that could delay or even reverse these epigenetic changes