BackgroundThe goal of this research is to study the psychosocial determinants of HIV-testing as a function of the decision or change stage concerning this health behavior. The determinants considered in the major ongoing health models and the stages contemplated in the Precaution Adoption Process Model are analysed.MethodsA cross-sectional survey was administered to 1,554 people over 16 years of age living in Spain by a computer-assisted telephone interview (CATI). The sample design was randomised, with quotas of sex and age. The survey measured various psychosocial determinants of health behaviors considered in the main cognitive theories, the interviewees' stage of change concerning HIV-testing (lack of awareness, decision not to act, decision to act, action, maintenance, and abandonment), and the signal for the action of getting tested or the perceived barriers to being tested.ResultsApproximately two thirds of the population had not ever had the HIV test. The predominant stage was lack of awareness. The most frequently perceived barriers to testing were related to the health system and to the stigma. We also found that the psychosocial determinants studied differed depending on the respondents' stage of change. Perception of risk, perceived self-efficacy, proximity to people who had been tested, perceived benefits of knowing the diagnosis, and a positive instrumental and emotional attitude were positively associated with the decision and maintenance of testing behavior. However, unrealistic underestimation of the risk of HIV infection, stereotypes about the infection, and the perceived severity of HIV were associated with the decision not to be tested.ConclusionsThere are various sociocognitive and motivational profiles depending on people’s decision stage concerning HIV-testing. Knowing this profile may allow us to design interventions to influence the psychosocial determinants that characterise each stage of change.Electronic supplementary materialThe online version of this article (doi:10.1186/s12889-017-4148-4) contains supplementary material, which is available to authorized users.