how soon after having sex can you take a pregnancy test

just now 1
Nature

A pregnancy test is most accurate when taken after a missed period, typically about 10 to 14 days after unprotected sex. Pregnancy tests detect the hormone human chorionic gonadotropin (hCG), which begins to be produced after the fertilized egg implants in the uterus, a process that can take 6 to 12 days post-ovulation. Therefore, taking a test too soon after sex may result in a false negative because hCG levels are not yet high enough to be detectable. If the menstrual cycle is irregular or unknown, it is advised to wait around 19 to 21 days after unprotected sex before taking a pregnancy test to ensure accuracy. Some early detection tests can be taken slightly earlier, but following the timing of a missed period is generally best for reliable results.