Erectile dysfunction (ED) means persistent difficulty getting or keeping an erection firm enough for sex. Having an off night once in a while is common and normal; ED is about a recurring pattern. It can come from blood-vessel disease, diabetes, medications, low testosterone, nerve problems, stress, anxiety, relationship factors, or several of these at once.
The single most useful idea on this page: ED describes a problem, it does not tell you why the problem is happening. And sometimes erectile dysfunction is the first clue that something outside the bedroom deserves attention. That is exactly why it is worth understanding rather than just reaching for a pill.
Common symptoms of erectile dysfunction
- Trouble getting an erection
- Trouble keeping an erection long enough for sex
- Erections that are not firm enough
- Erections that are inconsistent from one encounter to the next
Note: ED is not the same as low sex drive. Desire and erection function are related but different.
Common cause categories
- Blood flow / cardiovascular disease
- Diabetes and metabolic disease
- Medications
- Hormonal issues, including low testosterone
- Nerve problems
- Stress, performance anxiety, depression, relationship issues
- Smoking, alcohol, and other lifestyle factors
What is erectile dysfunction?
ED is persistent difficulty getting or maintaining an erection sufficient for sexual activity. Just as important is what it is not: it is not one bad night, not automatically a sign of low testosterone, not automatically a lack of attraction, not automatically "all in your head," and not an unavoidable part of getting older. That last point matters, ED is more common with age, but it is not a normal or inevitable part of aging.
What are the symptoms of erectile dysfunction?
Trouble getting an erection
Difficulty achieving an erection when you want one, either sometimes or consistently.
Trouble staying hard
Some men can get fully erect but lose firmness before or during sex. Losing the erection partway through is one of the most common patterns people describe, and it counts as ED when it recurs.
Erections that are only partially firm
Getting "semi-hard" but not firm enough for the sex you want, repeatedly, also falls under ED. An occasional partial erection is not a diagnosis; a consistent pattern of insufficient firmness is worth looking at.
ED that happens only sometimes
ED can be consistent, intermittent, or situational. A pattern that shows up with a partner but not during masturbation or morning erections often points more toward a psychological or performance component, but it still deserves a real history rather than an internet self-diagnosis.
Is low sex drive the same as erectile dysfunction?
No, and the distinction matters. Libido is desire. Erectile function is the physical ability to get and keep an erection. A man can have a strong sex drive and ED, low desire with normal erections, or both. Low testosterone can influence desire and sometimes contribute to ED, but low T is not the default explanation for erection problems. If desire is the bigger change for you, it is worth reading about the signs of low testosterone and how testosterone testing works.
What causes erectile dysfunction?
An erection is a coordinated event involving blood flow, nerves, hormones, and arousal, so a problem anywhere in that chain can cause ED. The main categories:
Blood-flow and cardiovascular problems
This is one of the most common physical causes, and arguably the most important to understand. Atherosclerosis, high blood pressure, high cholesterol, and heart disease all impair the blood vessels' ability to dilate and deliver blood. Erections are, at their core, blood-flow events, so when arteries cannot respond normally, erectile function suffers.
Can erectile dysfunction be an early sign of heart disease?
Yes, and it is one of the most useful things to understand about ED. Erectile dysfunction can sometimes be an early clue to underlying cardiovascular disease, because the two share many of the same risk factors and blood-vessel changes.
The penile arteries are smaller than many coronary arteries, so vascular dysfunction may become noticeable through erectile symptoms before more obvious cardiovascular symptoms appear. Current cardiovascular and sexual-medicine guidance considers ED an established risk marker for atherosclerotic cardiovascular disease, and in some studies ED has appeared roughly 2 to 5 years before clinically evident cardiovascular disease.
To be clear: ED does not prove you have heart disease, and most men with ED are not in immediate danger. But new or unexplained ED is a good reason to check your cardiovascular risk factors (blood pressure, cholesterol, blood sugar) rather than treating the erection in isolation. That is the difference between handing someone a pill and actually looking at their health.
Diabetes and metabolic causes
Diabetes is a major contributor to ED, because long-standing elevated blood sugar can damage both the blood vessels and the nerves that erections depend on. Obesity, metabolic syndrome, and high blood pressure travel in the same cluster and raise the risk as well. This does not mean every overweight man's ED is caused by weight, but metabolic health is a real and common piece of the puzzle.
Can low testosterone cause erectile dysfunction?
It can contribute, but it is usually not the whole story and often not the primary cause. Low testosterone tends to affect sexual desire more prominently than the mechanics of an erection, and ED frequently persists even when testosterone is normal. Because the two can overlap, current urology guidelines recommend a morning total testosterone measurement as part of the evaluation of men with ED, alongside the other causes. If you want the fuller picture, see signs of low testosterone in men and normal testosterone levels by age.
Medications that can contribute to ED
A number of common medication categories can contribute to ED, including some antidepressants, certain blood-pressure medications, diuretics, some pain medicines and opioids, sedatives, and some prostate or hormonal therapies. Whether a given medication is a factor depends on the individual.
Important: do not stop a prescribed medication because you suspect it is causing ED. Talk with the prescribing clinician about whether the medication, the dose, or an alternative could be contributing. Stopping certain medications on your own can be more dangerous than the ED.
Neurological and structural causes
Less common but important causes include nerve-related conditions and physical factors: spinal cord injury, multiple sclerosis, nerve damage, pelvic or prostate surgery, prostate cancer treatment, pelvic trauma, and Peyronie's disease (scar tissue that curves the penis). These are worth a provider's evaluation rather than guesswork.
Can stress or anxiety cause erectile dysfunction?
Absolutely, and this is especially common in younger men. Performance anxiety, general anxiety, depression, stress, relationship conflict, and low self-confidence can all cause ED or worsen an existing physical cause.
One erection problem can turn into a performance loop. Once your attention shifts from arousal to "am I going to lose it again?", the anxiety itself can make staying erect harder, which feeds more anxiety. Breaking that loop is often part of the solution, and it is a real, recognized pattern, not a personal failing.
Why can I get hard alone but not with a partner?
If your erections are normal during masturbation, in the morning, or during sleep, but consistently difficult in one sexual situation, that pattern points more strongly toward a situational or psychological component, things like performance anxiety, relationship tension, pressure, or fear of losing the erection. It does not prove the cause is purely psychological, but it is a genuinely useful clue to bring to a provider.
Is he not attracted to me if he can't stay hard?
Not necessarily. An erection is not a reliable lie detector for attraction. Stress, anxiety, medications, alcohol, vascular problems, diabetes, and hormone issues can all interfere with an erection even when attraction is completely present. Interpreting ED as rejection is common, and the relationship strain that follows can unfortunately make the problem worse, which is one more reason to treat it as a health issue rather than a verdict on the relationship.
Does porn or masturbation cause erectile dysfunction?
Masturbation itself is not an established general cause of ED. The research on pornography and erectile function is more complicated: problematic or compulsive use may coexist with sexual dissatisfaction, altered arousal patterns, or performance anxiety in some men, but "porn-induced ED" is not a diagnosis that should be assumed from symptoms alone. If your erections are consistently different during partnered sex than during masturbation, that difference is clinically useful information to discuss with a provider rather than a reason to panic.
Lifestyle factors that can contribute to ED
- Smoking, which damages blood vessels and impairs the circulation erections depend on. Yes, smoking can directly contribute to ED.
- Heavy alcohol use.
- Physical inactivity and obesity.
- Recreational drug use.
- Poorly managed chronic disease such as diabetes or high blood pressure.
The encouraging part is that several of these are modifiable, and improving them can improve erectile function over time.
Does age cause erectile dysfunction?
ED becomes more common with age, but aging itself does not make it inevitable. Erections may take a little longer to develop with age, and the health conditions that contribute to ED become more common over time, but "getting older" is not, by itself, a reason erections should disappear. Men in their 50s, 60s, and 70s can and do have normal erectile function. Age changes the probabilities, not whether an erection is supposed to happen.