We aimed to assess the role of computerized tomography attenuation values (Hounsfield unit—HU) for differentiating pyonephrosis from hydronephrosis and for predicting postoperative infectious complications in patients with obstructive uropathy. We analysed data from 122 patients who underwent nephrostomy tube or ureteral catheter placement for obstructive uropathy. A radiologist drew the region of interest for quantitative measurement of the HU values in the hydronephrotic region of the affected kidney. Descriptive statistics and logistic regression models tested the predictive value of HU determination in differentiating pyonephrosis from hydronephrosis and in predicting postoperative sepsis. A HU cut-off value of 6.3 could diagnose the presence of pyonephrosis with 71.6% sensitivity and 71.5% specificity (AUC 0.76; 95%CI: 0.66–0.85). At multivariable logistic regression analysis HU ≥ 6.3 (p ≤ 0.001) was independently associated with pyonephrosis. Patients who developed sepsis had higher HU values (p ≤ 0.001) than those without sepsis. A HU cut-off value of 7.3 could diagnose the presence of sepsis with 76.5% sensitivity and 74.3% specificity (AUC 0.79; 95%CI: 0.71–0.90). At multivariable logistic regression analysis, HU ≥ 7.3 (p ≤ 0.001) was independently associated with sepsis, after accounting for clinical and laboratory parameters. Measuring HU values of the fluid of the dilated collecting system may be useful to differentiate pyonephrosis from hydronephrosis and to predict septic complications in patients with obstructive uropathy. © 2020, The Author(s).