Excess adipose tissue may promote chronic systemic inflammation and oxidative stress, causing endothelial damage. Early evidence indicates that obesity may be associated with poorer cerebral perfusion. The purpose of this study was to examine the relationship between body composition and cerebral hemodynamics. A total of 248 middle-aged adults (50-58 years old; 55% women) underwent a ramp test on a cycle-ergometer until volitional exhaustion. Gas exchange was assessed on a breath-by-breath basis. Mean middle cerebral artery velocity (MCAv) was measured using transcranial Doppler, and pulsatility index (PI) calculated. Body composition was assessed by dual X-ray absorptiometry. Statistical analyses were performed using a compositional data approach including a three-compartment model for body composition (trunk fat mass, extremities fat mass, and fat-free mass). The unadjusted models for the whole sample showed that trunk fat mass relative to other compartments was negatively associated with MCAvrest, MCAvmax, and gain, and positively associated with PImax; extremities fat mass relative to other compartments was positively associated with MCAvrest and MCAvmax, and negatively associated with PImax; and fat-free mass relative to other compartments was positively associated with PImax. These associations were sex-dependent, remaining in the women's subgroup. However, after adjusting for confounders, these associations became non-significant, except for PImax in the whole sample and women's subgroup. These findings suggest a possible association between cerebral hemodynamics and body composition in middle-aged adults, highlighting sex-specific differences. Moreover, our results indicate that higher trunk fat mass relative to other compartments may negatively impact cerebral hemodynamics, reducing MCAv and increasing PImax.