Fluid imbalance is associated with various clinical conditions, but the association between elevated extracellular-water to total-body-water (ECW/TBW) ratio, an indicator of fluid balance, and cognitive impairment is unknown. We aimed to investigate relationship between ECW/TBW ratio and cognitive function in type 2 diabetes mellitus. This study was a cross-sectional design, comparing 1233 patients aged 61.4 ± 8.0 years from the Singapore Study of Macro-angiopathy and Micro-vascular Reactivity in Type 2 Diabetes (SMART2D) cohort. ECW/TBW was measured using bioelectrical impedance method. Cognitive function was assessed with Repeatable Battery for the Assessment of Neuropsychological Status (RBANS). Multiple linear regression was used to examine association between ECW/TBW and RBANS scores, adjusting for demographics, education, clinical covariates, and apolipoprotein E allele. In unadjusted analyses, there was an inverse dose-dependent association between ECW/TBW and RBANS total score. The associations persisted in fully adjusted model with β = -1.18 (95% confidence interval [CI] -2.19 to -0.17; P = 0.022) for slight edema and -2.33 (-3.99 to -0.67; P = 0.006) for edema. Slight edema and edema were significantly associated with reduced cognitive function in delayed memory and attention. There was significant association between edema but not slight edema, with reduced cognitive function in language. Pulse pressure accounted for 16.8% of association between ECW/TBW and RBANS total score. Our novel finding of an independent association between higher ECW/TBW and poorer cognitive function highlights the potential importance of maintaining body fluid balance in the management of cognitive impairment.