BACKGROUND Legislation or interventions aiming to improve social media safety should be informed by evidence. Most previous research has focused on the impact of the frequency with which people use social media, and finds conflicting results. However, the behaviours people perform on social media can be very different, even if their frequency of use is the same. For example, the use of social media late at night could lead to worse mental health outcomes than using social media during typical waking hours. If true, interventions discouraging nighttime social media activity might show promise for improving mental health. OBJECTIVE We aimed to explore the relationship between the time of day individuals post Tweets and their mental health outcomes. METHODS We linked Twitter (now ‘X’) data to self-reported measures of mental health and wellbeing from the Avon Longitudinal Study of Parents and Children (ALSPAC). We used a novel application of circular statistics to calculate the average hour each participant posted Tweets over a two-week period. We then produced models predicting depressive symptoms, anxiety and mental wellbeing from average hour of Tweet posting, fitted using data from 310 ALSPAC participants (27 – 70 years old). RESULTS We found strong evidence (all P-values ≤ 0.002) that the average hour a participant posted Tweets was associated with their depressive symptoms, anxiety symptoms and mental wellbeing. After taking into account age and sex, average hour explained almost 2% of the variation in mental wellbeing, comparable to previous reports of the impact of binge drinking and exercise. Participants who, on average, Tweeted through the night showed worse mental wellbeing than those who Tweeted during the daytime. This difference in mental wellbeing was above the threshold for what is generally considered clinically important. Although the average hour that a participant posted their Tweets explained less of the variation in their depressive (0.2%) and anxiety (0.7%) symptoms, after stratification by age and sex these relationships became stronger. CONCLUSIONS Our study shows that use of social media at nighttime is meaningfully associated with mental wellbeing. This has the potential to inform interventions for improving the safety of social media platforms by targeting specific behaviours.