Cancer remains a major cause of morbidity and mortality around the world. Improved cancer treatment requires enhancement of cancer diagnosis and detection. To achieve this goal, here we report a novel imaging probe, pH-responsive fluorescent graphene quantum dots (pRF-GQDs). pRF-GQDs were prepared by electrolysis of graphite rods in sodium p-toluenesulfonate acetonitrile solution. The resulting pRF-GQDs, which have minimal toxicity, display a sharp fluorescence transition between green and blue at pH 6.8, a pH matching the acidic extracellular microenvironment in solid tumors. We found that this unique fluorescence switch property allows tumors to be distinguished from normal tissues. In addition to fluorescence, pRF-GQDs also exhibit upconversion photoluminescence (UCPL). We demonstrate that the combination of UCPL and fluorescence switch enables detection of solid tumors of different origin at an early developmental stage. Therefore, pRF-GQDs have great potential to be used as a universal probe for fluorescence-guided cancer surgery and cancer diagnosis.