Gambling forms part of social and leisure activities for adolescents but is not free of potential harms. Moreover, with the emergence of new technologies, gambling has become increasingly accessible and appealing to this population. The aim of this study was to determine the magnitude of gambling behaviour and its associated factors in adolescents aged 13-19years in the city of Barcelona in 2021. A cross-sectional study was conducted using data from the 2021 Survey of Risk Factors in Secondary Schools. A bivariate analysis was carried out and multiple logistic regression models were constructed to estimate adjusted odds ratios and their 95% confidence intervals for online, non-online, and at-risk gambling. The prevalence of gambling among adolescents in Barcelona was 18.6% in boys and 6.1% in girls. Gambling was associated with various sociodemographic, health, and lifestyle factors, with differences observed by sex and gambling modality (online vs. non-online). The prevalence of at-risk gambling was 6.2% in boys and 1% in girls. At-risk gambling was associated with male sex, engaging in online gambling, poor mental health, and participating in more than two different types of gambling. The results of this study show that gambling is a widespread activity among adolescents in Barcelona, with significant associated risks. Preventive programmes and regulations are needed to reduce gambling involvement and gambling-related harms.