Human olfactory perception differs enormously between individuals, with large reported perceptual variations in the intensity and pleasantness of a given odour. For instance, androstenone (5alpha-androst-16-en-3-one), an odorous steroid derived from testosterone, is variously perceived by different individuals as offensive ("sweaty, urinous"), pleasant ("sweet, floral") or odourless. Similar variation in odour perception has been observed for several other odours. The mechanistic basis of variation in odour perception between individuals is unknown. We investigated whether genetic variation in human odorant receptor genes accounts in part for variation in odour perception between individuals. Here we show that a human odorant receptor, OR7D4, is selectively activated in vitro by androstenone and the related odorous steroid androstadienone (androsta-4,16-dien-3-one) and does not respond to a panel of 64 other odours and two solvents. A common variant of this receptor (OR7D4 WM) contains two non-synonymous single nucleotide polymorphisms (SNPs), resulting in two amino acid substitutions (R88W, T133M; hence 'RT') that severely impair function in vitro. Human subjects with RT/WM or WM/WM genotypes as a group were less sensitive to androstenone and androstadienone and found both odours less unpleasant than the RT/RT group. Genotypic variation in OR7D4 accounts for a significant proportion of the valence (pleasantness or unpleasantness) and intensity variance in perception of these steroidal odours. Our results demonstrate the first link between the function of a human odorant receptor in vitro and odour perception.