If you’ve been in close contact with someone who has COVID-19, or are worried that you may have, you can get tested to see if you have the virus. There are a variety of tests, including ones that are fast and inexpensive or that you can do at home.

Laboratory-based (often called PCR) testing is the most accurate way to detect COVID-19, says Dr. Campbell. These molecular tests use a process called polymerase chain reaction to find the actual genetic material or fragments of the virus, which comes in a small molecule known as RNA. This is more fragile and less stable than DNA, so the test must be done carefully to preserve the RNA.

Most PCR tests are also highly sensitive, which means they can catch most cases of COVID-19 and produce few false-negative results. But they also take longer to run, require trained personnel and special equipment, and have high sample transportation costs, he says.

RT-PCR, or real-time reverse transcriptase quantitative PCR, is another rapid test that uses the same type of technology as a traditional PCR test but it’s run in real time so it can detect a new infection faster than a PCR test can. This type of testing is especially good for surveillance purposes and can be done at schools, workplaces or anywhere else that needs to know who’s been exposed.

The test works by combining DNA naked from the sample with a DNA sequence that is specific to the SARS-CoV-2 virus. Those sequences are matched to primers that target specific parts of the viral genome, which is unique to SARS-CoV-2. After a primer and probe are made, the DNA is added to an amplification machine that generates high levels of DNA fragments. The amplification machine then detects the fragments of DNA, which match the SARS-CoV-2 genome.

These fragments are then measured for size to determine whether they contain the SARS-CoV-2 virus. The amplification process can be repeated several times and hundreds of samples can be tested at once.

Antigen tests, which are less accurate but much quicker, use the same amplification process as NAATs but they look for certain proteins on the surface of the virus that trigger the body’s immune system to make antibodies to fight it. They use a nasal swab to collect a sample and may be used at home, a standalone testing site or in a doctor’s office.

They’re available for anyone to buy online or at pharmacies, convenience stores and other retail outlets. They’re often sold in a kit that includes the swab, instructions and reagents needed to perform the test.

Some of these kits also include a prescription to get flu or respiratory syncytial virus (RSV) tests. Depending on your symptoms, your doctor may recommend you start taking Tamiflu or other treatment within 24 hours of your positive test result.

The best time to get a COVID-19 test is at least 5 days after you had contact with a person who has COVID-19, according to public health experts. That’s because you might be infected when you haven’t had symptoms, but it could be later in the illness’ life cycle and may have been spread through contact with an infected person before your test.