This study was conducted to evaluate the effect of nitrogen (N) and potassium (K) availability on root exudate composition of two sugarcane cultivars known to differ with regard to their resistance to drought and salinity stress. The plants were hydroponically grown in a greenhouse and subjected to three levels of N (0.1, 1.0, and 10 mM N) and three levels of K (0.02, 0.2, and 2 mM K). Nitrogen and K stress altered the xylem sap composition. Nitrogen stress significantly reduced nitrate (NO − 3 ), ammonium (NH + 4 ), calcium (Ca), magnesium (Mg), and amino acid content and increased the pH, phosphorus (P), and K content. Whereas, K stress significantly decreased pH, K, NH + 4 , and amino acid content but increased Ca, Mg, and P content. Nitrogen and K stress had opposing effects on xylem sap pH and osmolality. Results indicated that sugarcane plants recycle compounds between the phloem and xylem. The results also suggested that the NO − 3 and K concentration of xylem sap could be effectively used to estimate the N and K status of the soil solution.