Using data collected from a leading P2P platform in China, this paper empirically tests the discrimination of investors on the occupational identity of borrowers in online lending. I find that P2P investors discriminate against borrowers who are salary earners in terms of occupational identity while preferring borrowers who are private entrepreneurs. Moreover, this kind of discrimination can be found in borrowers both with high credit ratings and low credit ratings. The findings also imply that the occupational identity of borrowers plays a role of moderating the relationship between the credit rating and the probability of successful funding. Compared with private entrepreneurs, credit rating has a weaker effect on the probability of successful funding among salary earners. However, after examining the default rate, the results show that the default rate of private entrepreneurs is significantly higher than that of salary earners. This indicates that the discrimination of P2P investors is not based on some rational economic roots and is a kind of inefficient tasted-based discrimination.