BACKGROUND: Pistachio shell is a valuable lignocellulosic biomass because almost 90% of its hemicellulose fraction is xylan, which can be converted into high value-added compounds such as xylooligosaccarides, xylose, xylitol and furfural. The present study represents a green and novel approach to produce xylose from lignocellulosic biomass. Microwave-assisted high-pressure CO2/H2O hydrolysis (MW-HPCO2) comprising a combination never previously used was performed to produce xylose from pistachio shell. RESULTS: Response surface methodology with a Box–Behnken design was implemented to optimize microwave-assisted high-pressure CO2/H2O hydrolysis (MW-HPCO2). The effect of temperature, time and liquid-to-solid ratio was studied in the ranges of 180–210 °C, 10–30 min and 5–30 mL g−1, respectively. A maximum xylose yield of 61.39% and minimum degradation compounds (5-hydroxymethyl furfural and furfural) of 11.07% were attained under reaction conditions of 190 °C, 30 min and 18 mL g−1. CONCLUSION: The results showed that hydrolysis temperature, time and liquid-to-solid ratio had a strong influence on the xylose yield, as well as on the formation of degradation compounds. MW-HPCO2 significantly increased accessibility to cellulose-derived products in the subsequent enzymatic hydrolysis. The results of the present study reveal that MW-HPCO2 can be a promising green technique for the hydrolysis of lignocellulosic biomass. © 2023 The Authors. Journal of The Science of Food and Agriculture published by John Wiley & Sons Ltd on behalf of Society of Chemical Industry.