This study aimed to identify the sociodemographic and lifestyle factors associated with magnesium intake and describe the main food sources in the Brazilian Longitudinal Study of Adult Health (ELSA-Brazil). This observational, cross-sectional study was conducted using the baseline data from the ELSA-Brazil (2008-2010). Associations between usual magnesium intake and sociodemographic and lifestyle factors were analyzed using multiple linear regression. Food sources were identified by calculating the percentage contribution of each FFQ item to the amount of magnesium provided by all foods. The analysis was performed using Stata® software (version 12), assuming a statistical significance level of 5%. The top food sources to magnesium intake were as follows: beans, oats, nuts, white rice, orange, French bread, cooked fish, boneless meat, whole milk, and whole wheat bread. There were positive associations between magnesium intake and female sex; age ≥60 years; self-reported black, indigenous, or brown skin colors; per capita income ≥3 minimum wages, and moderate or vigorous physical activity levels. Sociodemographic and lifestyle factors were associated with magnesium intake among the evaluated individuals.