There's a period of time after a person is infected during which they won't test positive. This is called the HIV "window period."
The window period can be from 10 days to 3 months, depending on the person's body and on the HIV test that's used. During that time, you can test HIV-negative even though you're HIV-positive. You can still get HIV from someone who is in the window period. In fact, there is evidence that a person in the window period is more likely to pass the virus on.
If you've had high-risk exposure to HIV within the last few days, you should ask your test counselor about PEP – post-exposure prophylaxis (learn more about PEP).
What's the specific window period for different types of HIV tests?
Rapid antibody test – gives a positive result based on antibodies to HIV, not the virus itself. It takes your body up to 3 months to produce these antibodies at levels that can be detected by this test.
4-6 weeks (up to 3 months) after infection, most people will have enough antibodies to test positive.
12 weeks (3 months) after infection, about 98% of people will have enough antibodies to test positive.
Rapid antibody/antigen combination test – detects antibodies to HIV in addition to fragments of the virus called the p24 antigen. The p24 antigen can be detected in the body earlier than antibodies. According to the manufacturer:
12-26 days after infection, the p24 antigen can be detected by this type of test
20-45 days after infection, HIV antibodies can be detected by this type of test
RNA tests – show a positive result based on the presence of the virus. These tests are more expensive than antibody tests, so are not offered in as many places.
10-14 days after infection, there will be enough viral material for a positive result.
Home testing kits – As of Fall 2012, there are two "home tests" which have been approved by the FDA for use in the U.S.:
OraQuick by OraSure is an antibody test that you complete at home, usually conducted using oral fluid. According to the manufacturer, the window period is 3 months. Up to 1 in 12 people may receive a false negative result (i.e., the test says they’re negative, but they’re actually HIV-positive) with this test.
Home Access HIV-1 by Home Access Health Corp is not actually a test, but a sample-collection kit. You use it to collect a blood sample which you then mail to a lab for processing. This test is anonymous.
PCR tests (polymerase chain reaction tests) – also test for the actual virus. This type of test is often used for testing the viral load of HIV-positive people, as well as testing babies born to HIV-positive mothers. You can read more about PCR tests on the AIDS.gov website.
2-3 weeks after infection, there will be enough viral material for a positive result.