The tumor milieu consists of numerous cell types each existing in a different environment. However, a characterization of metabolic heterogeneity at single-cell resolution is not established. Here, we develop a computational pipeline to study metabolic programs in single cells. In two representative human cancers, melanoma and head and neck, we apply this algorithm to define the intratumor metabolic landscape. We report an overall discordance between analyses of single cells and those of bulk tumors with higher metabolic activity in malignant cells than previously appreciated. Variation in mitochondrial programs is found to be the major contributor to metabolic heterogeneity. Surprisingly, the expression of both glycolytic and mitochondrial programs strongly correlates with hypoxia in all cell types. Immune and stromal cells could also be distinguished by their metabolic features. Taken together this analysis establishes a computational framework for characterizing metabolism using single cell expression data and defines principles of the tumor microenvironment.