It is well established that tumours are not homogenous, but comprise cells with differing invasive, proliferative and tumour-initiating potential. A major challenge in cancer research is therefore to develop methods to characterize cell heterogeneity. In melanoma, proliferative and invasive cells are characterized by distinct gene expression profiles and accumulating evidence suggests that cells can alternate between these states through a process called phenotype switching. We have used microfluidic technology to isolate single melanoma cells grown in vitro as monolayers or melanospheres or in vivo as xenografted tumours and analyse the expression profiles of 114 genes that discriminate the proliferative and invasive states by quantitative PCR. Single-cell analysis accurately recapitulates the specific gene expression programmes of melanoma cell lines and defines subpopulations with distinct expression profiles. Cell heterogeneity is augmented when cells are grown as spheres and as xenografted tumours. Correlative analysis identifies gene-regulatory networks and changes in gene expression under different growth conditions. In tumours, subpopulations of cells that express specific invasion and drug resistance markers can be identified amongst which is the pluripotency factor POUF51 (OCT4) whose expression correlates with the tumorigenic potential. We therefore show that single-cell analysis can be used to define and quantify tumour heterogeneity based on detection of cells with specific gene expression profiles.