The evolution of stable social groups can be promoted by both indirect and direct fitness benefits. Sperm whales (Physeter macrocephalus) are highly social, with a hierarchical social structure based around core groups of adult females and subadults, a rare level of complexity among mammals. We combined long-term satellite tracking (ranging from 11 to 607 days) of 51 individual sperm whales with genetic kinship analysis to assess the pattern of kin associations within and among coherent social units. Unlike findings for other species with similar social structure, we find no consistent correlation between kinship and association apart from close associations between two pairs of first-order relatives. A third pair of first-order relatives did not associate, and overall, the mean relatedness was the same within as among social groups. However, social behaviour can also be promoted by ecological factors such as resource dispersion. We assessed putative foraging behaviour during travel from the satellite-tracking data, which suggested that prey resources were dispersed and unpredictable, a condition that could promote living in groups.