Knowledge-sharing research in online communities has primarily focused on communities of practice and the social factors of knowledge-sharing behavior in organizational contexts. Academic research has not rigorously examined non-business-oriented online communities as venues for facilitating knowledge sharing. Thus, in this paper, we address this research gap by examining the contextual roles of anonymity and community type on an individual’s social and individual drivers of knowledge-sharing attitude in social networking sites. Using social capital theory as a theoretical backbone, we propose and empirically validate a relational model through a survey of 329 users of Facebook, LinkedIn, and CNET. From analyzing the data with the partial least squares (PLS) method, we found strong explanatory power of the proposed research model. We discuss our study’s implications for both research and practice.