We investigate the representation of women and ethnic groups in TED talks, which reach a large online audience on YouTube with science-related content and topics on societal change. We argue that gaps in representation can create a misleading perception of science and the respective topics discussed in these talks. We validate annotations from an image recognition algorithm for identifying speaker ethnicity and gender to compile a data set of 2,333 TED talks and 1.2 million YouTube comments. Findings show that more than half of all talks were given by white male speakers. While the share of women increased over time, it is constantly low for non-white speakers. Topic modeling further shows that the share of talks addressing inequalities which affect both groups is low, but increasing over time. However, talks about inequalities and those given by female speakers receive substantially more negative sentiment on YouTube than others. Our findings highlight the importance of speaker and topic diversity on digital platforms to reduce stereotypes about scientists and science-related content.