During pre-implantation development, the mammalian embryo self-organizes into the blastocyst, which consists of an epithelial layer encapsulating the inner-cell mass (ICM) giving rise to all embryonic tissues1. In mice, oriented cell division, apicobasal polarity and actomyosin contractility are thought to contribute to the formation of the ICM2,3,4,5. However, how these processes work together remains unclear. Here we show that asymmetric segregation of the apical domain generates blastomeres with different contractilities, which triggers their sorting into inner and outer positions. Three-dimensional physical modelling of embryo morphogenesis reveals that cells internalize only when differences in surface contractility exceed a predictable threshold. We validate this prediction using biophysical measurements, and successfully redirect cell sorting within the developing blastocyst using maternal myosin (Myh9)-knockout chimaeric embryos. Finally, we find that loss of contractility causes blastomeres to show ICM-like markers, regardless of their position. In particular, contractility controls Yap subcellular localization6, raising the possibility that mechanosensing occurs during blastocyst lineage specification. We conclude that contractility couples the positioning and fate specification of blastomeres. We propose that this ensures the robust self-organization of blastomeres into the blastocyst, which confers remarkable regulative capacities to mammalian embryos.