The protective effect on peritoneum of L-carnitine and its lower alkanoyl derivatives, both in the form of inner or pharmaceutically acceptable salts is disclosed. Concentrations of carnitine from about 0.02 to 0.5% w/v are suitable for preparing a solution for peritoneal dialysis having higher biocompatibility and protecting peritoneum from toxic effects of continuous use of solutions for peritoneal dialysis, in particular ones containing glucose as osmotic agent. A particularly preferred embodiment is a solution for peritoneal dialysis containing carnitine, glucose and xylitol.