Cells perceive their microenvironment not only through soluble signals but also through physical and mechanical cues, such as extracellular matrix (ECM) stiffness or confined adhesiveness. By mechanotransduction systems, cells translate these stimuli into biochemical signals controlling multiple aspects of cell behaviour, including growth, differentiation and cancer malignant progression, but how rigidity mechanosensing is ultimately linked to activity of nuclear transcription factors remains poorly understood. Here we report the identification of the Yorkie-homologues YAP (Yes-associated protein) and TAZ (transcriptional coactivator with PDZ-binding motif, also known as WWTR1) as nuclear relays of mechanical signals exerted by ECM rigidity and cell shape. This regulation requires Rho GTPase activity and tension of the actomyosin cytoskeleton, but is independent of the Hippo/LATS cascade. Crucially, YAP/TAZ are functionally required for differentiation of mesenchymal stem cells induced by ECM stiffness and for survival of endothelial cells regulated by cell geometry; conversely, expression of activated YAP overrules physical constraints in dictating cell behaviour. These findings identify YAP/TAZ as sensors and mediators of mechanical cues instructed by the cellular microenvironment.