As a part of the learning culture today, undergraduates use social media for educational purposes. Many scholars have investigated the impact of using social media by university students to share knowledge. However, most of the studies investigated the effect of personality traits on knowledge-sharing behaviour in social media in the Western context. However, there is a shortage of studies in a non-western context. To fill this gap, the current study is conducted to investigate the impact of personality traits on knowledge-sharing behaviour in social media among undergraduates in the Sri Lankan context where the mediating role of interpersonal trust is also explored. This study was conducted as a cross-sectional survey. Stratified random sampling techniques were used to select the sample of 322 university undergraduates, which were used in the final analysis. The data were gathered through a standard questionnaire that was distributed via google form and a paper-pencil survey. An individual is a unit of analysis of this study. Regression analysis was used to test the research hypotheses with support from SPSS 26. It was found that the big five personality traits are associated with the online knowledge-sharing behaviour among university students. Further, it was found that personality traits (extraversion, openness, emotional stability, consciousness) lead to knowledge-sharing behaviour and undergraduates did not consider trustworthiness as a significant factor in online knowledge-sharing behaviour. It was suggested that even though, undergraduates are keen on knowledge sharing irrespective of the reliability of the sources, precautions should be taken to avoid data theft issues and personality problems. To encourage online knowledge sharing, policymakers should be created trustworthy social media platforms among university undergraduates.