The impact of the metabolic microenvironment on epigenetically plastic cancer cells underpins phenotypic heterogeneity, a major cause of metastasis and therapy resistance. Nutrient limitation is a key microenvironmental stress, and can cause cells to transition from proliferative to invasive phenotypes, however, whether cancer cells have the capacity to delay phenotype switching remains unknown. Here, using melanoma as a model, we reveal that the ability to buffer glucose availability by accumulating and mobilizing glycogen can determine cancer cell phenotypic transitions. While proliferating cells contain high levels of glycogen, invasive cells are marked by depleted glycogen stores. Accordingly, the inability to store and metabolize glycogen leads to phenotype instability and a switch from proliferation to invasion. The amount of stored glycogen inversely correlates with tissue invasion depth in primary melanomas, and reduced expression of the glycogen phosphorylases PYGB/L and phosphoglucomutase 1 (PGM1) is associated with worse patient survival. Together, we identify metabolic glucose buffering as a determinant of invasive phenotype transitions in skin cancer, suggesting similar paradigms in other cancer types.