Prejudice and discrimination in the workplace regarding the risk of transmission of Hepatitis B virus (HBV) and Hepatitis C virus (HCV) are increased by excess concerns due to a lack of relevant knowledge. Education to increase knowledge about HBV and HCV and their prevention could be the first step to reduce prejudice and discrimination. This study aimed to determine the association between the level of knowledge and negative attitudes toward HBV- and HCV-infected colleagues among the Japanese working population. An online anonymous nationwide survey involving about 3,000 individuals was conducted in Japan. The questionnaire consisted of knowledge of HBV and HCV, and attitudes toward HBV- and HCV-infected colleagues in the workplace. Knowledge was divided into three categories: "ensuring daily activities not to be infected"; "risk of infection"; and "characteristics of HBV/HCV hepatitis", based on the result of factor analysis. Multiple logistic regression analysis was applied. A total of 3,129 persons responded to the survey: 36.0% reported they worried about the possibility of transmission of HBV and HCV from infected colleagues; 32.1% avoided contact with infected colleagues; and 23.7% had prejudiced opinions about HBV and HCV infection. The participants were classified into tertiles. A higher level of knowledge of HBV and HCV was significantly associated with these three negative attitudes (P for trend < 0.005). This study suggests that increasing knowledge may decrease individuals' negative attitudes towards HBV- and HCV-infected colleagues. Thus, we should promote increased knowledge of HBV and HCV in stages to reduce negative attitudes toward HBV- and HCV-infected colleagues.