To evaluate the effects of a web-based, personalized avatar intervention conveying the concept of community immunity (herd immunity) on risk perception (perceptions of the risk of infection spreading (to self, family, community, and vulnerable individuals)) and other cognitive and emotional responses across 4 vaccine-preventable disease contexts: measles, pertussis, influenza, and an unnamed "vaccine-preventable disease." Through a robust user-centered design process, we developed a web application, " herdimm ," showing how community immunity works. In our application, people personalize a virtual community by creating avatars (themselves, 2 vulnerable people in their community, and 6 other people around them; e.g., family members or co-workers.) Herdimm integrates these avatars in a 2-minute narrated animation showing visually how infections spread with and without the protection of community immunity. The present study was a 2×4 factorial randomized controlled trial to assess herdimm 's effects. We recruited 3883 adults via Qualtrics living in Canada who could complete an online study in English or French. We pre-registered our study, including depositing our questionnaire and pre-scripted statistical code on Open Science Framework ( https://osf.io/hkysb/ ). The trial ran from March 1 to July 1, 2021. We compared the web application to no intervention (i.e. control) on primary outcome risk perception, divided into objective risk perception (accuracy of risk perception) and subjective risk perception (subjective sense of risk), and on secondary outcomes-emotions (worry, anticipated guilt), knowledge, and vaccination intentions-using analysis of variance for continuous outcomes and logistic regression for dichotomous outcomes. We conducted planned moderation analyses using participants' scores on a validated scale of individualism and collectivism as moderators. Overall, herdimm had desirable effects on all outcomes. People randomized to herdimm were more likely to score high on objective risk perception (58.0%, 95% confidence interval 56.0%-59.9%) compared to those assigned to the control condition (38.2%, 95% confidence interval 35.5%-40.9%). Herdimm increased subjective risk perception from a mean of 5.30 on a scale from 1 to 7 among those assigned to the control to 5.54 among those assigned to herdimm . The application also increased emotions (worry, anticipated guilt) (F(1,3875)=13.13, p<0.001), knowledge (F(1,3875)=36.37, p<0.001) and vaccination intentions (Chi-squared(1)=9.4136, p=0.002). While objective risk perception did not differ by disease (Chi-squared(3)=6.94, p=0.074), other outcomes did (subjective risk perception F(3,3875) = 5.6430, p<0.001; emotions F(3,3875)=78.54, p<0.001; knowledge (F(3,3875)=5.20, p=0.001); vaccination intentions Chi-squared (3)=15.02, p=0.002). Moderation models showed that many findings were moderated by participants' individualism and collectivism scores. Overall, whereas outcomes tended not to vary by individualism and collectivism among participants in the control condition, the positive effects of herdimm were larger among participants with more collectivist orientations and effects were sometimes negative among participants with more individualist orientations. Conveying the concept of community immunity through a web application using personalized avatars increases objective and subjective risk perception and positively influences intentions to receive vaccines, particularly among people who have more collectivist worldviews. Including prosocial messages about the collective benefits of vaccination in public health campaigns may increase positive effects among people who are more collectivist while possibly backfiring among those who are more individualistic.