Yes, you can have sex before a Pap smear, but it is best to avoid vaginal sex for about 48 hours before the test when possible. Recent intercourse may make the cervical sample harder to collect or interpret accurately.
Sex can cause temporary inflammation, and semen, lubricants, or other material may obscure cervical cells. For this reason, several medical organizations recommend avoiding vaginal intercourse for 1 to 2 days before a Pap test, with 48 hours being the most commonly recommended timeframe.
If you had sex within 48 hours of your appointment, you usually do not need to cancel the Pap smear. Keep the appointment and tell the healthcare professional performing the test so they can decide whether the sample can be collected as planned or whether rescheduling would be preferable.
Preparation may be different if you are having an HPV test without a Pap test, since HPV-only testing may not require special preparation. Follow the specific instructions given by your gynecologist or testing clinic, and avoid douching, vaginal medicines, or spermicidal products before a Pap test when instructed.