According to Mayo Clinic, HIV is usually diagnosed by testing your blood or a sample of cells taken with a swab from inside your cheek for the presence of antibodies to the virus. HIV tests vary in how soon they are able to detect infection. The time between when you get the virus and when it can be detected is called the window period. It can take up to three to 12 weeks for your body to make enough antibodies for an antibody test to detect HIV infection. It usually takes a few days to a few weeks to get results of an HIV test, although rapid HIV tests can produce results in about 20 minutes. Regardless of the type of screening test used, if you have an initial positive result, you'll need follow-up testing to establish an HIV diagnosis.