Abstract Background Network-based interventions have the potential to prevent socioeconomic inequalities in health behaviors but require a good understanding of the underlying social network mechanisms. We investigated whether (1) adolescents selected friends with a similar socioeconomic status (SES), (2) smoking and alcohol consumption spread in networks, and (3) the exclusion of non-smokers or non-drinkers differed between SES groups. Methods We applied Stochastic Actor Oriented Models to the complete social network data (“Wired into Each Other” data) of 253 adolescents in eight Hungarian secondary school classes over three waves between 2010 and 2013. SES was measured based on entitlement to an income-tested regular child protection benefit. Results High SES adolescents were most likely to form friendships with peers from their own SES group (odds ratio [OR] = 1.1, 95% Confidence Interval [CI] = 1.0-1.1). Adolescents adjusted their smoking behavior (OR = 24.0, 95% CI 1.3-454.9) but not their alcohol consumption (OR = 1.6, 95% CI 0.6-4.4) to emulate the behavior of their friends. Smokers did not differ from non-smokers in the likelihood of receiving a friendship nomination (OR = 1.0, 95% CI 0.9-1.1), regardless of their SES. Alcohol consumers received significantly more friendship nominations than non-consumers (OR = 1.2, 95% CI 1.0-1.3), but this association was not significantly different according to SES. Conclusions Socioeconomic inequalities in health behaviors were driven by preferences to form friendships within their own SES group and the spread of smoking and alcohol consumption in the network. These inequalities were not amplified by SES differences in encouraging smoking or drinking. Main messages: In three waves of observations in a Hungarian adolescent cohort, the study found social network effects for inequalities in smoking and alcohol consumption. Key messages • Inequalities in health behaviors arise because adolescents with high socioeconomic backgrounds selected each other as friends and smoking/alcohol consumption spread in networks. • Inequalities were not due to socioeconomic differences in encouraging harmful behaviors.