By identifying endogenous molecules in brain extracellular fluid metabolomics can provide insight into the regulatory mechanisms and functions of sleep. Here we studied how the cortical metabolome changes during sleep, sleep deprivation and spontaneous wakefulness. Mice were implanted with electrodes for chronic sleep/wake recording and with microdialysis probes targeting prefrontal and primary motor cortex. Metabolites were measured using ultra performance liquid chromatography-high resolution mass spectrometry. Sleep/wake changes in metabolites were evaluated using partial least squares discriminant analysis, linear mixed effects model analysis of variance, and machine-learning algorithms. More than 30 known metabolites were reliably detected in most samples. When used by a logistic regression classifier, the profile of these metabolites across sleep, spontaneous wake, and enforced wake was sufficient to assign mice to their correct experimental group (pair-wise) in 80-100% of cases. Eleven of these metabolites showed significantly higher levels in awake than in sleeping mice. Some changes extend previous findings (glutamate, homovanillic acid, lactate, pyruvate, tryptophan, uridine), while others are novel (D-gluconate, N-acetyl-beta-alanine, N-acetylglutamine, orotate, succinate/methylmalonate). The upregulation of the de novo pyrimidine pathway, gluconate shunt and aerobic glycolysis may reflect a wake-dependent need to promote the synthesis of many essential components, from nucleic acids to synaptic membranes.