If you've had unprotected sex and might've been exposed to HIV, the most time-critical step is PEP — HIV medicine that can stop the virus from taking hold, but only if you start it within 72 hours. Treat it as a same-day emergency. For everything else, you'll test on a timeline that depends on the specific infection.

72 hours
Start within

sooner is better — every hour counts

28 days
Course

taken daily

emergencies
Use

not a substitute for PrEP

ER / urgent care
Where
PEP at a glance. Source: CDC.
PEP at a glance
ItemValue
Start within72 hours — sooner is better — every hour counts
Course28 days — taken daily
Useemergencies — not a substitute for PrEP
WhereER / urgent care

Quick answer: what to do after unprotected sex

There are two clocks running, and they're different. If there's any chance you were exposed to HIV, PEP (post-exposure prophylaxis) must be started within 72 hours of the exposure, and the sooner the better CDC PEP. The second clock is testing: most STDs don't show up on a test the day after sex, so you'll come back once enough time has passed. This page walks through both so you have one plan instead of two half-answers. For the bigger picture of next steps, see our guide on what to do after unprotected sex.

PEP: the 72-hour window that comes first

PEP is a short course of HIV medicine you take after a possible exposure to keep the virus from establishing an infection. It's for emergencies only — a one-time, time-sensitive intervention you shouldn't lean on repeatedly. Consider it after a condom breaks or slips during sex, after sharing needles or injection equipment, or after sexual assault. It also applies to a possible exposure at work, such as a needlestick.

The window is firm. PEP has to be started within 72 hours (3 days) of the exposure, and after that it no longer works. The clock starts at the moment of exposure, so don't let a day slip by deciding. Every hour matters. This is a same-day errand. Once you're prescribed PEP, you take it every day for 28 days to finish the job.

Where do you get it fast? Call a health care provider, go to an emergency room, or use an urgent care clinic — any of them can start PEP. Don't let cost stall you. Ask about patient-assistance programs and start the medicine while the paperwork gets sorted out, because what you need is pills in hand inside the window, not a settled bill.

PEP is not ongoing prevention. If you find yourself reaching for it after repeated possible exposures, ask your provider about PrEP — daily medicine taken before exposure — instead of running to the ER each time CDC PrEP. There's also good evidence that getting people with HIV into treatment early protects their partners, since earlier hiv treatment can help prevention.

How STD testing works

Most STD testing after unprotected sex uses simple samples. A urine sample or a swab (genital, throat, or rectal, depending on the kind of sex you had) covers chlamydia and gonorrhea — these are nucleic-acid amplification tests, which detect the bacteria's genetic material and are highly sensitive. HIV, syphilis, and hepatitis are blood tests, run from a small draw or a fingerstick. Some panels combine several of these so one visit handles the common infections.

No single test covers everything, and the right swab site matters. A urine test won't catch a throat infection from oral sex. When you book, tell whoever orders the test what kind of contact you had, so they collect from the right places.

When to test after exposure (the window period)

Testing too early is the most common mistake. A test the morning after won't reliably detect an infection that needs time to become measurable. Each infection has its own window, the gap between exposure and when a test turns reliably positive. Test before that window closes and you risk a false-negative that gives false reassurance.

As a rough map: chlamydia and gonorrhea become detectable within a couple of weeks, while HIV, syphilis, and hepatitis can take longer to show up and may need a follow-up test to confirm. Because the exact timing differs by infection and test type, use our detailed guide on when to test after exposure to find the right day for each one rather than guessing.

A practical approach: if you've started PEP for HIV, you'll still test for the other STDs on their own schedules, and you'll have HIV testing built into your PEP follow-up. If you didn't need PEP, mark your calendar for the appropriate window rather than testing the next day and assuming you're clear.

Where to get tested and what it costs

You have several routes, and the cheapest one isn't always the slowest. Options include your primary care provider, urgent care, a sexual health or community clinic (many offer free or low-cost testing), and at-home or mail-in lab tests you order online. When you're ready to set it up, you can get tested through the option that fits your situation.

OptionBest forSpeed
Primary care / clinicFull panel plus a clinician to talk toDays for results
Urgent care / ERUrgent concerns and starting PEPSame day for PEP
Community / sexual health clinicLow or no cost, confidentialVaries
At-home / mail-inPrivacy and convenienceMail turnaround

Cost varies widely by route and whether insurance applies. If you want to weigh privacy, price, and turnaround across mail-in services, you can compare testing providers before you order. For anything urgent — especially a possible HIV exposure inside the 72-hour window — skip the comparison shopping and go straight to urgent care or the ER.

Reading your results and how accurate they are

A negative result is only as trustworthy as your timing. If you tested before the window closed for that infection, a negative doesn't fully rule it out, and you may need a repeat test later. A negative taken after the proper window is reliable for that infection. The amplification tests used for chlamydia and gonorrhea are very accurate when the sample is collected from the right site at the right time.

Some blood tests, particularly for HIV and syphilis, use a two-step process: an initial screening test, and a confirmatory test if the first is reactive. A reactive screen isn't a diagnosis on its own; the confirmatory result is what counts. If a result is unclear or comes back reactive, your provider will walk you through the next step.

If a result is positive

A positive result is manageable. Nearly every common STD is curable or treatable, and the sooner you start, the better. We cover regimens, what to expect, and partner notification in our treatment guide; start there for your specific diagnosis.

When to see a clinician

See someone the same day if there's any chance of HIV exposure within the last 72 hours — that's the PEP window and it won't wait. Also seek care promptly if you have symptoms like burning with urination, unusual discharge, genital sores or rashes, pelvic or testicular pain, fever, or if you were sexually assaulted. Don't try to self-diagnose a sore or wait out a symptom; a clinician can test the right sites and start treatment without delay.