Neuroactive compounds are synthesized by certain plants and microorganisms by undertaking different tasks, especially as a stress response. Most common nouroactivo compounds in foods arc gamma-aminobutyric acid (GABA), serotonin, melatonin, kynurenine, kynurenic acid, dopamine, norepinephrine, histamine, tryptamine, tyramine and beta-phenylethylamine. Fermented foods contain some of these compounds, which can affect human health and mood. Moreover, food processing such as roasting and malting alter amount and profile of neuroactive compounds in foods. In addition to plant-origin and microbially-formed neuroactive compounds in foods, these substances are also formed by gut microbiota, which is the most attractive subject to assess the interaction between gut microbiota and mental health. The discovery of microbiota-gut-brain axis calls for the investigation of the effects of diet on the formation of neuroactive compounds in the gut. Furthermore, probiotics and prebiotics are indispensable elements for the understanding of the food-mood relationship. The focus of this comprehensive review is to investigate the neuroactive compounds found naturally in foods or formed during fermentation. Their formation pathways in humans, plants and microorganisms, potential health effects, effects of diet on the formation of microbial metabolites including neuroactive compounds in the gut are discussed throughout this review. Furthermore, the importance of gut-brain axis, probiotics and prebiotics are discussed.