Epididymitis is swelling and pain in the epididymis, a tightly coiled tube that sits behind each testicle and stores sperm. Orchitis is swelling of the testicle itself. The two often happen together (epididymo-orchitis), and most cases come from a bacterial infection that antibiotics can cure. Sudden, severe pain in a testicle can also mean a twisted testicle, which needs emergency surgery, so don’t wait to get checked.
Key points
- In men under 35, sexually transmitted infections such as chlamydia and gonorrhea are the most common cause.
- In older men, the usual cause is bacteria from the urinary tract, often linked to prostate problems or a urinary catheter.
- Mumps is the classic cause of orchitis on its own. The MMR vaccine prevents it.
- Pain from epididymitis usually builds over a day or two. Pain that starts suddenly and is severe is an emergency.
- If an STI is the cause, recent sex partners need testing and treatment too.
What causes epididymitis and orchitis
Epididymitis
- Sexually transmitted infections. Chlamydia and gonorrhea are the main causes in sexually active men under 35. Germs from the bowel, such as E. coli, can also cause it in men who have anal sex.
- Urinary tract germs. In men over 35, bacteria from a bladder or prostate infection can travel backward into the epididymis. An enlarged prostate, a urinary catheter, or a recent procedure on the urinary tract raises the risk.
- Other causes. Heavy lifting or straining can push urine back into the epididymis. This can inflame it without any germs (chemical epididymitis). Other causes include an injury, a heart rhythm medicine called amiodarone, and, rarely, tuberculosis. In boys, epididymitis is often caused by inflammation rather than infection, sometimes linked to urine flowing the wrong way.
Orchitis
- Bacteria spreading from the epididymis. This is the most common cause in adults.
- Mumps. Orchitis can start about 4 to 8 days after the cheek and jaw swelling of mumps. It mostly affects teens and men who weren’t vaccinated.
Symptoms of epididymitis and orchitis
- Pain and tenderness in the scrotum, usually on one side, building over a day or more
- Swelling, redness or warmth of the scrotum
- A tender lump at the back or top of the testicle
- Burning when you pee, or needing to pee often
- Fluid leaking from the penis, when an STI is the cause
- Fever and chills
- Pain that may spread to the groin or lower belly
Is it a twisted testicle?
Testicular torsion happens when a testicle twists on the cord that carries its blood supply. Pain usually starts suddenly and is severe, often with nausea and vomiting, and the testicle may sit higher than usual. It’s most common in boys and young men. A twisted testicle can die within hours without surgery. Symptoms can overlap with epididymitis, so sudden, severe pain always needs emergency care.
How it’s diagnosed
- Exam. A doctor gently checks the testicles, the epididymis and the groin.
- Urine tests. A urine sample is checked for signs of infection and tested for chlamydia and gonorrhea. You may also be offered tests for HIV and syphilis.
- Ultrasound. A painless scan with color images of blood flow can rule out torsion and look for a pocket of pus (abscess).
Treatment
Antibiotics
Treatment usually starts right after testing, before results come back. The choice depends on the most likely germ:
- If an STI is likely, the usual treatment is an antibiotic shot of ceftriaxone plus about 10 days of doxycycline pills.
- If bowel or urinary germs are likely, a different antibiotic such as levofloxacin may be used, alone or with the shot.
Take every dose, even when you feel better. If your symptoms don’t start to improve within about 3 days, see your doctor again.
If an STI is the cause
- Anyone you’ve had sex with in the past 60 days should be tested and treated.
- Avoid sex until you and your partners have finished treatment and your symptoms are gone.
Comfort at home
- Rest, and lie down with a rolled towel under the scrotum to raise it.
- Wear snug briefs or an athletic supporter to hold the scrotum up.
- Use a cold pack wrapped in a cloth for 15 to 20 minutes at a time.
- Take ibuprofen or acetaminophen for pain, if they’re safe for you.
Mumps orchitis
Antibiotics don’t work on viruses. Treatment is rest, support, cold packs and pain relief. Symptoms usually ease within a week or two.
Recovery
Pain usually eases within a few days of starting antibiotics. Swelling and firmness can take several weeks, sometimes longer, to settle. Possible problems include an abscess that needs draining, pain that lasts more than 6 weeks (chronic epididymitis), and a testicle that shrinks over time. Lasting fertility problems are uncommon, and more likely when both sides are affected.
Lowering your risk
- Use condoms, and get tested for STIs if you have new or multiple partners.
- Make sure you and your children have had two doses of the MMR vaccine.
- Get urinary symptoms and prostate problems checked and treated.
When to see a doctor
- Pain, swelling or tenderness in the scrotum that came on gradually
- Burning when you pee or discharge from the penis
- No improvement within about 3 days of starting antibiotics
- A lump in a testicle that stays after the swelling settles. Testicular cancer can feel like a painless lump, so it needs checking.
Get emergency care for sudden, severe pain in a testicle, pain with nausea or vomiting, a testicle that sits higher than usual, or a high fever with a red, very swollen scrotum.
Common questions about epididymitis
What’s the difference between epididymitis and orchitis?
Epididymitis affects the coiled tube behind the testicle, and orchitis affects the testicle itself. Epididymitis is far more common and is usually caused by bacteria. Orchitis on its own is often caused by mumps. When infection spreads from one to the other, the treatment is the same.
Can epididymitis be cured?
Yes. Antibiotics cure most bacterial epididymitis, and pain usually eases within a few days. Most men recover fully. Swelling can take weeks to settle completely. A few men have pain that lasts for months. They need to see a urinary tract specialist (urologist).
Can mild epididymitis go away on its own?
Don’t count on it. Even mild symptoms often come from an infection that needs antibiotics. An untreated STI can spread to partners or lead to an abscess. Some cases without infection get better with rest and pain relief. Only a doctor can tell which kind you have.
Can epididymitis cause blood from the penis?
Sometimes. Infection in the epididymis, prostate or urethra can cause a little blood in semen or urine. This usually clears once the infection is treated. Any blood from the penis needs a doctor’s visit to find the cause, especially if you’re over 40 or it keeps happening.
Is epididymal hypertension the same as epididymitis?
No. Epididymal hypertension, often called “blue balls,” is a dull ache in the testicles after sexual arousal without ejaculation. It’s harmless and fades within hours. Epididymitis causes swelling and soreness that last for days and needs a doctor’s visit. It often comes with fever or burning when you pee.
Questions to ask your doctor
- What is the most likely cause of my symptoms?
- Have you ruled out a twisted testicle?
- Should my partner be tested or treated?
- How long will the swelling last?
- Could this affect my fertility?
Learn more
- Epididymitis (MedlinePlus, U.S. National Library of Medicine)
- Orchitis (MedlinePlus, U.S. National Library of Medicine)
This guide is general information and doesn’t replace advice from your own doctor. Last updated October 2026.



