The remarkable ecological and demographic success of humanity is largely attributed to our capacity for cumulative culture. The accumulation of beneficial cultural innovations across generations is puzzling because transmission events are generally imperfect, although there is large variance in fidelity. Events of perfect cultural transmission and innovations should be more frequent in a large population. As a consequence, a large population size may be a prerequisite for the evolution of cultural complexity, although anthropological studies have produced mixed results and empirical evidence is lacking. Here we use a dual-task computer game to show that cultural evolution strongly depends on population size, as players in larger groups maintained higher cultural complexity. We found that when group size increases, cultural knowledge is less deteriorated, improvements to existing cultural traits are more frequent, and cultural trait diversity is maintained more often. Our results demonstrate how changes in group size can generate both adaptive cultural evolution and maladaptive losses of culturally acquired skills. As humans live in habitats for which they are ill-suited without specific cultural adaptations, it suggests that, in our evolutionary past, group-size reduction may have exposed human societies to significant risks, including societal collapse.