Despite the general focus on an invasive and de-differentiated phenotype as main driver of cancer metastasis, in melanoma patients many metastatic lesions display a high degree of pigmentation, indicative for a differentiated phenotype. Indeed, studies in mice and fish show that melanoma cells switch to a differentiated phenotype at secondary sites, possibly because in melanoma differentiation is closely linked to proliferation through the lineage-specific transcriptional master regulator MITF. Importantly, while a lot of effort has gone into identifying factors that induce the de-differentiated/invasive phenotype, it is not well understood how the switch to the differentiated/proliferative phenotype is controlled. We identify collagen as a contributor to this switch. We demonstrate that collagen stiffness induces melanoma differentiation through a YAP/PAX3/MITF axis and show that in melanoma patients increased collagen abundance correlates with nuclear YAP localization. However, the interrogation of large patient datasets revealed that in the context of the tumour microenvironment, YAP function is more complex. In the absence of fibroblasts, YAP/PAX3-mediated transcription prevails, but in the presence of fibroblasts tumour growth factor-β suppresses YAP/PAX3-mediated MITF expression and induces YAP/TEAD/SMAD-driven transcription and a de-differentiated phenotype. Intriguingly, while high collagen expression is correlated with poorer patient survival, the worst prognosis is seen in patients with high collagen expression, who also express MITF target genes such as the differentiation markers TRPM1, TYR and TYRP1, as well as CDK4. In summary, we reveal a distinct lineage-specific route of YAP signalling that contributes to the regulation of melanoma pigmentation and uncovers a set of potential biomarkers predictive for poor survival.