Background: Evidence has shown that serum uric acid (UA) is associated with cognitive function, but this finding remains debatable. Serum UA is commonly elevated in patients with chronic heart failure (CHF), especially in men. However, the relationship between serum UA and cognitive function in CHF populations and stratified by sex are unclear. We aimed to examine whether serum UA was independently associated with cognitive function in CHF populations after controlling for demographic, medical and psychological variables and whether there was a sex difference in the association between serum UA and cognitive function among male and female CHF patients. Methods: One hundred ninety-two hospitalized patients with CHF underwent an assessment of cognitive function using the Montreal Cognitive Assessment (MoCA) and the determination of serum UA. Hyperuricemia was defined as serum UA ≥7 mg/dl in men and ≥ 6 mg/dl in women. Multiple linear hierarchical regression analyses were conducted to examine the independent association between serum UA and cognitive function in CHF populations and stratified by sex. Results: The mean serum UA concentration of participants was 7.3 ± 2.6 mg/dL. The prevalence of hyperuricemia was 54.7% (105 of 192) in CHF patients, 52.9% (64 of 121) in men, and 57.7% (41 of 71) in women. In the total sample, higher serum UA was associated with poorer cognitive function independent of demographic, medical and psychological variables (β = − 0.130, ΔR 2 = 0.014, p = 0.015). In sex-stratified groups, elevated serum UA was independently associated with worse cognitive function in men (β = − 0.247, ΔR 2 = 0.049, p = 0.001) but not in women (β = − 0.005, ΔR 2 = 0.000, p = 0.955). Conclusions: Higher serum UA is independently associated with poorer cognitive function in CHF populations after adjusting for confounding variables. Furthermore, elevated serum UA is independently related to worse performance on cognitive function in men but not in women. More longitudinal studies are needed to examine the association between serum UA and cognitive function in CHF populations and stratified by sex.