We offer a flexible latent type approach to rank populations according to unequal health opportunities. Building upon the latent-class method, an approch increasingly adopted to estimate health inequalities, our contribution is to let the number of socioeconomic groups considered vary to obtain an opportunity-inequality curve for a population that gives how the between-type inequality varies with the number of types. A population A is said to have less inequality of opportunity than population B if its curve is statistically below that of population B. This version of the latent class approach allows for a robust ranking of 31 European countries regarding inequality of opportunity in health.