Switzerland, particularly its western region, has the highest incidence of melanoma in Europe. Although the risk of melanoma increases with sun overexposure during childhood, sun-related knowledge and attitudes of Swiss children are scarcely documented. We report the first investigation of the knowledge of the danger of ultraviolet radiation, attitudes towards a suntan and parental influence of schoolchildren in western Switzerland. All fifth, eighth and eleventh graders (average ages of 9, 12 and 15, respectively) in the 18 primary (fifth grade, n=431) and secondary (eighth and eleventh grades, n=837) public schools of La Chaux-de-Fonds were surveyed during regular school classes. The response rate was 91% (1154/1268). Sun-related knowledge was high overall. Eight out of 10 children knew about the risk of skin cancer and recognized the most susceptible phototype. Knowledge increased significantly with age. Girls, older children, fair-skinned participants and those who preferred a tanned skin obtained the highest knowledge score. The main source of information on ultraviolet radiation and sun protection was their parents (76%), followed by the school (11%) and the media (9%). Multivariate logistic regression analyses identified higher sun-related knowledge, lower familial socioprofessional status and skin phototypes III–IV to be associated with a tan-seeking attitude. Parental sensitization (56%) and encouragement (61%) towards sun protection were more common among fair-skinned children and those of higher familial socioprofessional status. The high awareness of the risk of skin cancer among Swiss schoolchildren does not translate into appropriate attitudes. Community-wide intervention programmes involving parents, teachers, peers and primary care clinicians could be considered for Swiss prevention campaigns to improve children’s sun behaviour and change their current pro-tan attitude.