Delirium deteriorates the quality of life in patients with cancer, but is frequently underdiagnosed and not adequately treated. In this study, we evaluated the occurrence of delirium and its risk factors in patients admitted to the hospital for treatment or palliative care in order to develop a prediction model to identify patients at high risk for delirium. In a period of 1.5 years, we evaluated the risk of developing delirium in 574 consecutively admitted patients with cancer to our academic oncology department with the Delirium Observation Screening Scale. Risk factors for delirium were extracted from the patient's chart. A delirium prediction algorithm was constructed using tree analysis, and validated with fivefold cross‐validation. A total of 574 patients with cancer were acutely (42%) or electively (58%) admitted 1733 times. The incidence rate of delirium was 3.5 per 100 admittances. Tree analysis revealed that the predisposing factors of an unscheduled admittance and a metabolic imbalance accurately predicted the development of delirium. In this group the incidence rate of delirium was 33 per 100 patients (1:3). The AUC of the model was 0.81, and 0.65 after fivefold cross‐validation. We identified that especially patients undergoing an unscheduled admittance with a metabolic imbalance do have a clinically relevant high risk to develop a delirium. Based on these factors, we propose to evaluate preventive treatment of these patients when admitted to the hospital in order to improve their quality of life.