Chlamydia and gonorrhea are the two most common STDs that cause pain in the testicles. They do this by triggering a condition called epididymitis, an infection and inflammation of the coiled tube (the epididymis) that sits behind each testicle and carries sperm. A less common STD called Mycoplasma genitalium can cause the same problem. The pain isn’t from the STD attacking the testicle directly. It’s from bacteria traveling up through the urinary and reproductive tract until they reach the epididymis, where they cause swelling, tenderness, and sometimes significant pain.
How STDs Lead to Testicular Pain
During unprotected sex, bacteria like chlamydia or gonorrhea enter the urethra. From there, they migrate upward through the reproductive tract until they reach the epididymis. This triggers inflammation that causes aching or sharp pain, usually on one side. When the infection spreads to the testicle itself, it’s called epididymo-orchitis, and the pain and swelling tend to be more severe.
The pain typically develops gradually over a few days, which is one key difference from other causes of sudden testicular pain. You might notice a dull ache at first that worsens, along with swelling, warmth, or redness on one side of the scrotum. Some men also have a discharge from the penis or burning during urination, but not always. Chlamydia in particular is often “silent” in its early stages, meaning the first noticeable symptom might be the testicular pain itself.
Which STDs Are Involved
Chlamydia
Chlamydia is the most frequently diagnosed bacterial STD and one of the top causes of epididymitis in sexually active men under 35. Symptoms, when they appear, typically start 5 to 14 days after exposure. Many men have no symptoms at all from the initial urethral infection, so testicular pain can seem to come out of nowhere weeks or even months later if the bacteria have been quietly spreading.
Gonorrhea
Gonorrhea tends to produce more obvious early symptoms than chlamydia, including discharge and painful urination, often within five days of exposure. Painful, swollen testicles are a recognized complication. Gonorrhea and chlamydia frequently occur together as a co-infection, so testing for both is standard when either is suspected.
Mycoplasma Genitalium
This is a newer addition to the list. Mycoplasma genitalium has been linked to urethritis, and there is growing evidence connecting it to epididymitis as well. In one documented case, a 33-year-old man had persistent testicular pain for over a year that was ultimately traced to this organism after standard testing hadn’t identified a cause. It’s less common than chlamydia or gonorrhea but worth knowing about, especially if initial STD tests come back negative and symptoms persist.
Herpes and Trichomoniasis
Genital herpes doesn’t typically cause deep testicular pain the way chlamydia or gonorrhea does. Herpes pain is usually on the surface of the skin: sores, itching, or tingling on the penis, scrotum, or surrounding areas. Some people experience shooting nerve pain in the legs, hips, or buttocks during outbreaks, and in rare cases herpes can cause internal inflammation of urogenital organs. But if your main symptom is a deep ache inside the testicle, herpes is unlikely to be the cause.
Trichomoniasis, a parasitic STD, can cause urethral irritation and discomfort but is not a well-established cause of epididymitis or direct testicular pain in men.
How It’s Diagnosed
If you go in with testicular pain, the first thing a provider will do is figure out whether you’re dealing with an infection or something more urgent like testicular torsion, which is a medical emergency requiring surgery. These two conditions can look similar at first, but they present differently in important ways.
Testicular torsion tends to hit suddenly and severely, often with nausea or vomiting. The affected testicle may sit higher than normal or be positioned at an unusual angle. Epididymitis from an STD, by contrast, usually builds over hours to days, and the pain is often concentrated behind or below the testicle where the epididymis sits. Providers use physical exam findings, sometimes combined with ultrasound imaging, to tell the two apart. Urine analysis is also part of the workup: signs of infection in the urine point toward epididymitis, though they don’t completely rule out torsion.
To identify the specific STD, you’ll typically provide a urine sample that’s tested using nucleic acid amplification, which detects bacterial genetic material with high accuracy. This can identify chlamydia, gonorrhea, and Mycoplasma genitalium. A urethral swab may also be used. These tests can confirm which organism is responsible, which matters because the treatment differs depending on the cause.
What Treatment Looks Like
STD-related epididymitis is treated with antibiotics. The specific regimen depends on which bacteria are involved, and your provider will choose based on your test results and risk factors. Treatment usually involves a combination of antibiotics to cover the most likely infections, since chlamydia and gonorrhea often occur together.
Most men start feeling better within a few days of starting antibiotics, though the swelling can take weeks to fully resolve. During recovery, rest, supportive underwear, and over-the-counter pain relief help manage discomfort. You should avoid sexual contact until both you and your partner have completed treatment. Sexual partners need to be tested and treated as well to prevent passing the infection back and forth.
What Happens if It Goes Untreated
This is the part that matters most. Left untreated, STD-related epididymitis can cause lasting damage to fertility. An analysis of pooled data found that roughly 10% of men who’ve had acute epididymitis develop a complete absence of sperm in their ejaculate afterward, and another 30% end up with significantly reduced sperm counts. In most cases, sperm levels that drop during the acute infection recover within three to six months, but for that combined 40%, the damage persists.
Untreated infections can also become chronic. Chronic epididymitis means ongoing or recurring scrotal pain lasting six weeks or longer, sometimes much longer. In the Mycoplasma genitalium case mentioned earlier, the patient dealt with pain for over a year before the cause was identified and treated. The infection had progressed to a chronic granulomatous condition that required surgical removal of the affected tissue.
There’s also the risk of abscess formation, where a pocket of pus develops in the scrotum and may require drainage. And because the underlying STD is still active, it can continue to spread to sexual partners during this time.
Why Testicular Pain Shouldn’t Be Ignored
Testicular pain in sexually active men has a short list of serious causes, and STDs sit near the top. The combination of testicular pain with any of the following makes an STD-related cause more likely: pain that developed gradually, recent unprotected sex, discharge from the penis, or burning with urination. But because chlamydia can be asymptomatic for weeks before causing epididymitis, you don’t need other symptoms to be present for an STD to be the culprit.
Sudden, severe testicular pain that comes on within minutes is a different situation entirely and needs emergency evaluation to rule out torsion, where the blood supply to the testicle gets cut off. That’s a time-sensitive surgical problem. The gradual, building ache of epididymitis is serious too, but for different reasons: it’s the fertility and chronic pain risks that make prompt treatment essential.

