Children in Nigeria are frequently born with HIV, despite available services to prevent mother-to-child transmission (MTCT). Not offering, or non-acceptance of, HIV testing during antenatal care (ANC) delays anti-retroviral commencement for infected women, thereby increasing the risk of MTCT. This study assessed the determinants of HIV testing during antenatal care in Nigeria using nationally representative data from the 2013 Nigerian Demographic Health Survey. This study included 13,352 women aged 15–49 years who reported having at least one antenatal visit. The outcome variables were HIV testing during ANC and during labour, while socio-demographic and maternal factors, including number of ANC visits, offer of HIV testing during ANC and labour, place of delivery and knowledge and counselling on MTCT, were among the independent variables. Multivariate regression analysis was used to predict HIV testing during ANC and labour. About half (53%) of the women were tested for HIV during antenatal care with 85% of those tested receiving their test results. Only 6% had HIV tests during labour. There was a 33% excess probability of urban women testing during ANC compared with rural women. Never having a previous pregnancy terminated was associated with lower odds of testing during ANC. No counselling on MTCT and no counselling to get tested were associated with a lower probability of testing during ANC. Counselling on the prevention of MTCT is crucial for women’s willingness to be tested, and acceptance of testing. More effort is needed to ensure that providers in Nigeria offer these services to all women, educate women on the dangers of opting out and ensure the earliest commencement of ARV enrolment for those infected.