Clostridium difficile infection (CDI) is one of the most common causes of nosocomial infectious diarrhea in children during anticancer therapy or undergoing hematopoietic stem cell transplantation (HSCT) in Europe. Immunosuppression in these patients is a risk factor for CDI. Malignant diseases, age, acute graft-versus-host disease (aGVHD), HLA mismatch, or use of total body irradiation may play an important role in CDI course. The aim of this study was to evaluate the incidence, course, and outcome of CDI in children treated for malignancy or undergoing HSCT. Between 2012 and 2015, a total number of 1846 patients were treated for malignancy in Polish pediatric oncological centers (PHO group) and 342 underwent transplantation (HSCT group). In PHO group, episodes of CDI occurred in 210 patients (14%). The incidence of CDI was higher in patients with hematological malignancies in comparison to that with solid tumors. Patients with acute myeloblastic leukemia had shorter time to episode of CDI than those with acute lymphoblastic leukemia. Patients over 5 years and treated for acute leukemia had more severe clinical course of disease in PHO group. In HSCT group, CDI occurred in 29 (8%) patients. The incidence of CDI was higher in patients transplanted for acute leukemia. The recurrence rate was 14.7% in PHO and 20.7% in HSCT patients. CDI incidence was highest in patients with hematological malignancies. Most of patients experienced mild CDI. Age < 5 years and diagnosis other than acute leukemia were the positive prognostic factors influencing clinical CDI course.