Abstract Background Neonatal anemia contributes to the global burden of anemia, a crucial public health concern. It is primarily associated with mild to severe neurological impairment, which may result in perinatal mortality and morbidity. This study aimed to determine the prevalence of anemia and its association with sex and age in newborns at Al-Baha, Saudi Arabia. A retrospective observational study was performed using the R-studio/r-base coding tool. The analysis included the mean, standard deviation, median, interquartile range, correlation matrix, and logistic regression. The overall prevalence of neonatal anemia was 25.36% (n = 140). The mean±SD of hemoglobin (Hgb) (g/dl) was significantly different between anemic and nonanemic neonates, with values of 9.36 ± 1.04 and 15.74 ± 3.35 (P < 0.0001). The prevalence of neonatal anemia in males and females was 29.8% and 20.5%, respectively. Among males, the neonatal anemia Severity was 14.4% (mild anemia) and 6.1% (moderate anemia), while among females, it was 20.1% (mild anemia) and 9.7% (moderate anemia). In female neonates, the prevalence of microcytic, normocytic, and macrocytic anemia was 6.08%, 62.36%, and 31.56%, respectively. In contrast, the prevalence rate of microcytic, normocytic, and macrocytic anemia among male neonates, was 8.3%, 54.4%, and 29.07%, respectively. In females, only normocytic iron deficiency anemia was observed (55%), whereas the prevalence of normocytic iron deficiency anemia and microcytic iron deficiency anemia in males was 69% and 31%, respectively. Overall, iron deficiency anemia affected 65% of males. Compared with neonates aged 0-90 days, neonates aged 90-180 days have ~0.4 times more likelihood of developing neonatal anemia. Female sex is one of the risk factors associated with anemia. Further investigation and implementation of preventive measures are crucial to address the prevalence and severity of neonatal anemia.