A lot of men quietly wonder what causes erectile dysfunction in men under 40, and if it means something is seriously wrong. You might blame stress or a bad night of sleep, but often there is more than one factor at play. The good news is that ED is common, usually treatable, and sometimes even reversible once you understand what is going on.
Below, you will find clear, straightforward answers so you can make sense of your symptoms and know when to talk with a doctor.
How erections usually work
To understand why erections fail, it helps to know what has to go right first. Sexual arousal is not just about your penis. It involves your brain, hormones, nerves, muscles, and blood vessels all working together at the same time (Mayo Clinic).
When you are turned on, your brain sends signals down the spinal cord to the nerves in your penis. Those signals tell blood vessels to open up so blood can rush into the erectile tissue. At the same time, veins that drain blood away narrow so blood stays in place and your erection stays firm. Anything that disrupts these steps in your brain, hormones, nerves, or blood vessels can lead to ED.
How common ED is in younger men
You are not the only one dealing with this, even if it feels that way. In a study of men seeking help for erection issues, about 1 in 4 were under the age of 40, and nearly half of those younger men had severe ED (Yale Medicine). More recent reviews show that both physical and psychological causes are common in this age group, often at the same time (NCBI – Cureus).
So if you are struggling with erections in your twenties or thirties, you are not unusual and you are not broken. It is a medical issue like any other, and you deserve real answers.
Psychological reasons for ED under 40
For many younger men, the most important piece of the puzzle sits in the mind rather than the body. Psychological and emotional factors are the most common cause of erectile dysfunction in men under 40, including depression, anxiety, stress, and relationship troubles (Cleveland Clinic).
Performance anxiety and stress
You might notice that you get a firm erection alone, but lose it with a partner. That pattern often points to performance anxiety. You worry about staying hard, which increases stress hormones, which then make it harder to get and keep an erection. This creates a loop where a minor physical issue becomes a bigger problem because you are worried about it (Mayo Clinic).
Work pressure, money problems, family responsibilities, or chronic stress in general can have a similar effect. When your brain is busy handling stress, it has a hard time switching into a relaxed, aroused state.
Depression, anxiety, and other mental health conditions
Depression can lower your sex drive and make it difficult to feel mentally present during sex. Anxiety can keep your nervous system on high alert instead of relaxed and aroused. Studies show a bidirectional relationship where ED can both result from and contribute to depression and anxiety in younger men (NIH – PMC; NCBI – Cureus).
In other words, mental health issues can cause ED, and ongoing ED can make your mood worse if you feel ashamed or disconnected from your partner.
Relationship issues and sexual confidence
Tension with a partner, lack of trust, or unresolved conflict can also show up in the bedroom. Relational issues are known to worsen ED, while improvements in erectile function often lead to better sexual satisfaction for both partners (NIH – PMC).
Many experts, including urologists at Mayo Clinic, point out that for men under 40 confidence issues are very common drivers of ED, even when the body is otherwise healthy (Mayo Clinic).
Physical causes of ED in men under 40
Although psychological factors are common, you should not assume your ED is “all in your head.” Research now shows that organic, or physical, reasons account for 15 to 72 percent of ED cases in men under 40 (PubMed).
These are some of the main physical causes.
Blood vessel and heart issues
Healthy blood flow is essential for an erection. Vascular causes of ED in younger men often include arterial blockages or problems with the lining of blood vessels. Some men have focal arterial occlusive disease that limits blood flow to the penis (PubMed).
Conditions that affect your heart and blood vessels can show up first as ED because the arteries in the penis are smaller and more sensitive to damage. Early signs of arterial hardening, high blood pressure, high cholesterol, or diabetes can all limit blood flow. ED can appear an average of three years before a major heart problem, which means it can be an early warning sign of cardiovascular disease, especially in younger men (Yale Medicine; NIH – PMC).
Neurological and spinal causes
Your brain and spinal cord carry the signals that start and maintain an erection. Any condition that interrupts those nerve signals can cause ED. In younger men, neurogenic causes include multiple sclerosis, epilepsy, injuries near the spinal cord, or pelvic trauma (PubMed; Cleveland Clinic).
Even if you feel otherwise healthy, a past accident or sports injury to the pelvis or lower back may contribute.
Hormone and endocrine issues
Hormones also play a role. Low testosterone is linked with ED in younger men and is often associated with other metabolic problems, such as high triglycerides and increased waist circumference (NIH – PMC). Thyroid disorders and other endocrine conditions can also affect sexual function (NCBI – Cureus).
You might notice low energy, reduced muscle mass, or low sex drive along with erection issues if hormones are involved.
Peyronie’s disease and penile injury
Peyronie’s disease, which involves scarring inside the penis that can cause a curve or painful erections, affects about 8 percent of men under 40. Around 21 percent of those men also experience ED (PubMed). Injuries or trauma directly to the penis can also damage tissues and lead to difficulty getting or keeping an erection (Cleveland Clinic).
If you notice a new bend, pain during erections, or a firm lump in your penis, it is worth bringing this up with a doctor.
Medications that can cause ED
Several commonly used medications list ED or reduced libido as possible side effects. These include certain antidepressants, nonsteroidal anti-inflammatory drugs (NSAIDs), finasteride (Propecia), antiepileptics, and some neuroleptics (PubMed; Cleveland Clinic).
If your erection issues started soon after a new prescription, do not stop the medication on your own. Talk with your prescriber about options instead. There may be alternative drugs or dose adjustments that can help.
If you are under 40 and have had consistent ED for more than three months, specialists recommend a medical evaluation to check for underlying physical and psychological causes (Mayo Clinic).
Lifestyle habits that raise your risk
Your daily habits can have a surprisingly big impact on erection quality. Lifestyle factors are significant contributors to ED in men under 40, and changes in this area can sometimes reverse symptoms (Cleveland Clinic).
Studies have linked the following to ED in younger men (NCBI – Cureus; Mayo Clinic):
- Smoking
- Excessive alcohol intake
- Recreational drug use
- Obesity and a larger waistline
- Poor diet and lack of exercise
- Inadequate sleep
- Frequent pornography use
- Poor overall health
These habits can damage blood vessels, disrupt hormone levels, and increase stress or fatigue. Substance use, especially alcohol and drugs that suppress the central nervous system, can directly interfere with erections by dulling nerve responses and harming blood vessels (Cleveland Clinic).
The encouraging part is that many of these factors are changeable. Improving your diet, moving more, sleeping better, cutting back on alcohol, or quitting smoking can all improve both your general health and your erections.
The role of COVID‑19 and recent changes
More recent research suggests that the COVID 19 pandemic has also played a part in ED rates among younger men. The virus itself can affect the vascular endothelium, the lining of your blood vessels. At the same time, the stress, anxiety, social isolation, and increased pornography use during lockdowns may have added psychogenic strain on sexual function (NCBI – Cureus).
If you noticed new or worse ED after COVID infection or during the pandemic period, you are not alone and it is reasonable to mention this timeline to your doctor.
Why you should not ignore ED in your 20s or 30s
Erectile dysfunction can feel embarrassing, so you might be tempted to ignore it or hope it goes away on its own. Sometimes it does, especially if it is linked to a short term stressor or a single bad night of sleep. However, persistent ED can be an early sign of more serious issues.
Because the small arteries of the penis often show cardiovascular problems before the larger coronary arteries, ED in younger men can be the sole indicator of future heart disease, particularly if you have other risk factors like diabetes, obesity, or high cholesterol (Yale Medicine; Mayo Clinic).
Talking with a healthcare professional is not only about improving your sex life. It is also a way to check your heart, metabolic health, and mental health early, when changes can make the biggest difference.
What you can do next
You do not need to figure this out by yourself. You can start with a few practical steps:
-
Notice patterns
Pay attention to when ED happens. Do you have erections during sleep or masturbation but not with a partner? Did symptoms start after a new medication, illness, or major life stress? -
Make small lifestyle upgrades
Aim for regular movement, more whole foods, less smoking and heavy drinking, and a consistent sleep schedule. These shifts support both heart health and sexual health. -
Address stress and mental health
Consider speaking to a therapist, especially if you have anxiety, depression, or relationship tension. Behavioral therapies can build confidence and help break the worry cycle that worsens ED (Mayo Clinic). -
Talk openly with a doctor
If ED has lasted longer than three months or is causing you distress, reach out to a primary care provider or urologist. Be honest about your symptoms, medications, lifestyle, and mental health. They can help you decide whether lab tests, heart evaluation, counseling, or medications like Viagra, Cialis, or Levitra make sense for you (Yale Medicine). -
Be cautious with unproven treatments
You might see advertisements for shockwave therapy or stem cell injections promising a cure. Major centers, including Mayo Clinic, recommend caution since these approaches are not yet well proven for ED and may not be safe or effective for everyone (Mayo Clinic).
Understanding what causes erectile dysfunction in men under 40 is the first step toward taking control. ED is often the result of several overlapping factors, from stress and confidence to blood flow and hormones. With the right information, open communication, and a bit of support, you can improve both your erections and your overall health.