The purpose of this study was to determine the effect of homelessness on the costs and patterns of hospitalisation in patients with HIV/AIDS. A retrospective longitudinal study design, based on medical records data covering 2,768 person-years of observation between 1997 and 2003 on patients with HIV/AIDS, was employed. A contextual measure of neighbourhood socioeconomic status (SES) was also used to uncover differences among low- and high-SES neighbourhood dwellers. The association of homelessness and neighbourhood SES with total annual hospitalisation costs, length of stay, numbers of hospital and emergency department admissions and the probability of an operating room procedure, controlling for other covariates, was assessed using multivariate regression analysis. Our results suggest that the homeless and low-SES neighbourhood residents had a large proportion of total costs attributable to admissions for acute events related to the progression of disease. Hospitalisations for planned operating room procedures comprised a relatively larger proportion of hospitalisation costs for high-SES neighbourhood residents. One implication of our findings is that improvements in the continuity of care and cost savings on inpatient care may be realised through further development of social assistance programs aimed at reaching the homeless and residents of low-SES neighbourhoods.