While the majority of medical inpatients in Uganda are assumed to be HIV-positive, HIV testing is limited in inpatient settings. This study describes HIV testing practices and risk behavior among medical inpatients at an urban hospital in Uganda. We interviewed 395 adults on the day of discharge. Overall, 46% tested for HIV before or during admission. Of the 20% tested during hospitalization, 64% were HIV-positive. Among 47% who had sex in the previous year, only 14% used condoms consistently and only 20% knew the HIV status of their sexual partner, indicating that participants would benefit from risk-reduction counseling. Yet, only 26% of participants tested during hospitalization received post-test counseling. Half of the participants with HIV-related illnesses left the hospital without being offered the test, a missed opportunity for HIV prevention counseling and care. The findings indicate that hospitals are important venues for HIV counseling and testing.