Studies have revealed that upward social comparison on social network sites (SNSs) was a risk factor for depressive symptoms, however, little is known about the underlying processes that may mediate or moderate this relationship. This study extended prior research by examining the mediating role of self-esteem and the moderating role of optimism in this relationship. A sample of 1205 Chinese undergraduate students completed measures of upward social comparison on SNSs, depressive symptoms, self-esteem, and optimism. Results showed that self-esteem partially mediated the relation between upward social comparison on SNSs and depressive symptoms. In addition, the direct effect of upward social comparison on SNSs on depressive symptoms and the mediating effect of self-esteem were both moderated by optimism. The two effects were more potent for individuals with low optimism than for those with high optimism. The present study contributes to a better understanding of how and when upward social comparison on SNSs increases the risk of depressive symptoms. Limitations and implications of this study are discussed. (C) 2017 Elsevier Ltd. All rights reserved.