
Erectile dysfunction in your 20s and 30s - what causes it?
Peer reviewed by Dr Colin Tidy, MRCGPAuthored by Thomas Andrew Porteus, MBCSOriginally published 10 Nov 2026
Meets Patient’s editorial guidelines
- DownloadDownload
- Share
- Language
- Discussion
- Ask Patient
- Audio Version
- Add to preferred sources on Google
Erectile dysfunction is often associated with growing older, but it can affect people at any age. If you are in your 20s or 30s and find it difficult to get or keep an erection, you are not alone. It can be frustrating or upsetting, particularly if it feels unexpected, but it is often possible to identify contributing factors and find a treatment that helps.
Stress, anxiety, and relationship difficulties can all affect erections. Physical health conditions, medicines, and lifestyle factors can also play a part. Understanding what might be behind the issue is the first step towards getting support.
What is erectile dysfunction?
Erectile dysfunction (ED) is the persistent or recurring difficulty achieving an erection, or keeping one firm enough for sexual activity.
Having trouble getting an erection occasionally is common. It can happen when you are tired, stressed, have drunk too much alcohol, or are not feeling sexually aroused. This does not necessarily mean you have ED.
If erection issues keep happening, cause you concern or affect your sex life, it is worth speaking to your doctor.
"Erectile dysfunction in your 20s and 30s is far more common than most men realise, and in younger men the cause is often psychological, such as stress, anxiety, or pressure to perform. Lifestyle factors - including smoking, heavy drinking, recreational drugs, and poor sleep - can also play a big part. The most important thing is not to suffer in silence. Speaking to a pharmacist or GP is the first step, and there are safe, effective options available.”
Aisana Pandya, Senior Clinician and Head of Clinical Ops, Evaro
What causes erectile dysfunction in your 20s and 30s?
There is no single cause of ED in younger adults. Sometimes several factors overlap, and it is not always immediately obvious what is responsible.
1. Performance anxiety and stress
Worrying about whether you will get an erection can make it harder to get one. You might have had difficulty once and then become anxious about it happening again.
This can create a cycle. You start thinking about whether your erection will last, become more anxious, and find it harder to become or stay aroused.
Stress at work, financial worries, family issues, and other pressures can also affect sexual function. Anxiety and depression may contribute, too.
Performance anxiety is a real physical response, not something you can necessarily overcome by simply relaxing.
Support from a doctor, counsellor, or psychosexual therapist can help.
2. Relationship difficulties
Conflict, a lack of trust, worries about intimacy, or feeling disconnected from a partner can affect sexual desire and erections.
You may find that erections are easier when masturbating than during partnered sexual activity. This can sometimes suggest that anxiety, expectations, or relationship dynamics are contributing, although it does not rule out a physical cause.
Talking openly with a partner, where you feel comfortable doing so, can take some pressure off sex. Psychosexual therapy may also help individuals or couples work through difficulties.
3. Alcohol, smoking, and recreational drugs
Alcohol can make it harder to get or maintain an erection, particularly after drinking heavily. Regular heavy drinking can also affect hormones, nerves, and blood vessels involved in sexual function.
Smoking damages blood vessels and can reduce blood flow to the penis. Recreational drugs may affect sexual arousal, erections, and general health, although their effects vary.
If erection issues tend to happen after drinking or taking drugs, reducing or avoiding them may help. If the issue continues when you are sober, do not assume alcohol or drugs are the only explanation.
4. Poor sleep and tiredness
Sleep plays an important role in hormone regulation, mood, and sexual function. Being exhausted, working shifts, or regularly getting too little sleep can affect your interest in sex and your ability to get an erection.
Sleep apnoea - a condition in which breathing repeatedly stops and starts during sleep - is also associated with erectile dysfunction.
Improving your sleep routine may help, but persistent ED should not automatically be put down to tiredness.
5. Medical conditions
Physical causes are possible at any age. An erection depends on healthy blood vessels, nerves, hormones, and sexual arousal, so issues affecting any of these systems can contribute.
Possible causes include:
Diabetes - high blood sugar can damage blood vessels and nerves.
High blood pressure and high cholesterol - these can affect blood flow.
Hormonal issues - low testosterone can affect sexual desire and sometimes erections. Thyroid disorders and other hormone imbalances may also contribute.
Neurological conditions or injuries - damage affecting the nerves involved in erections can interfere with sexual function.
Obesity and metabolic health issues - these can increase your chance of developing diabetes, vascular disease, and hormonal changes.
Erectile dysfunction can sometimes be an early sign of cardiovascular disease, because the blood vessels supplying the penis may be affected before other symptoms become obvious.
This does not mean that ED in a younger adult necessarily indicates heart disease, but it is one reason not to ignore persistent symptoms.
6. Medicine side effects
Some prescribed medicines can affect erections, sexual desire, or ejaculation. These include certain antidepressants, some medicines for high blood pressure, and other treatments.
If your symptoms began after starting a medicine or changing your dose, tell your doctor. Do not stop taking prescribed medication without medical advice, as there may be a safer alternative.
7. Pornography and masturbation
Some people worry that watching pornography or masturbating frequently has caused their ED. There is no clear evidence that masturbation itself causes erectile dysfunction.
However, some people find that their arousal becomes strongly associated with particular types of stimulation or circumstances, which may not be easily replicated during partnered sex. Others experience anxiety or unrealistic expectations linked to pornography.
If you regularly get erections when masturbating but struggle during partnered sexual activity, this may be useful information when discussing the issue with a healthcare professional. It does not, by itself, establish the cause.
How can you tell whether ED is psychological or physical?
There is no simple test you can do at home to distinguish psychological from physical erectile dysfunction. Both can occur together.
Some patterns may offer clues:
Erections during masturbation but not partnered sex - anxiety, relationship factors, or differences in stimulation may be contributing.
Erections that vary with stress or circumstances - this may suggest a psychological component.
Difficulty getting or keeping erections in most situations - a physical cause becomes important to consider.
Fewer spontaneous or morning erections - this can sometimes be associated with physical or hormonal factors, although morning erections also vary naturally.
These are clues, not diagnostic rules. Having morning erections does not rule out a physical issue, and not having them regularly does not automatically mean something is wrong.
What should you do if you have ED in your 20s or 30s?
If it happens occasionally, consider whether tiredness, alcohol, or stress might explain it. Try to avoid turning sex into a test of whether you can get an erection. Taking the pressure off penetration and allowing time for arousal can help, whatever your gender or sexual orientation.
If the issue keeps happening, book an appointment with your doctor. You do not need to wait until it becomes severe, and you do not need to feel embarrassed about raising it.
Your doctor may ask about your symptoms, general health, medicines, lifestyle, and relationships. They may check your blood pressure and arrange blood tests, depending on your circumstances. These might include tests for diabetes, cholesterol, or testosterone where appropriate.
The assessment is not just about erections. It can also identify health issues that benefit from early treatment.
What treatments are available?
Treatment depends on the cause, your preferences and your general health. You may need more than one approach.
Lifestyle changes
Regular physical activity, stopping smoking, moderating alcohol intake, improving sleep, and addressing weight or blood sugar concerns can support erectile function and overall health.
These changes can be helpful, particularly when cardiovascular risk factors are involved, but they are not a substitute for assessment if symptoms persist.
Erectile dysfunction medicines
Medicines such as sildenafil (Viagra), tadalafil, vardenafil, and avanafil help increase blood flow to the penis in response to sexual stimulation.
They are commonly used treatments for ED and can help younger adults as well as older people. They do not automatically cause an erection or increase sexual desire.
A doctor or pharmacist can advise on suitability. In the UK, sildenafil may be available from a pharmacy following an assessment, while other options generally require a prescription. NHS access to ED medicines can be subject to eligibility rules, so ask your doctor or pharmacist what is available to you.
These medicines are not suitable for everyone, particularly people taking nitrate medicines for chest pain. Tell your healthcare professional about your medicines and health conditions before using them. Avoid unregulated online products, which may contain incorrect doses or undeclared ingredients.
Psychological or psychosexual therapy
If anxiety, depression, stress, or relationship issues are contributing, talking therapies or psychosexual therapy may help. Therapy can also be useful alongside medication if you have become worried about erections after previous difficulties.
You do not need to prove that your ED is psychological before seeking this support.
Treatment for an underlying condition
If ED is linked to diabetes, high blood pressure, high cholesterol, a hormonal issue, or medicine side effects, addressing that cause may improve symptoms.
Testosterone treatment is only appropriate for people with confirmed testosterone deficiency and relevant symptoms. It is not a general treatment for erectile dysfunction and should not be taken without proper assessment.
If first-line treatments do not help, your doctor can review how you have been using them and discuss other options, including vacuum erection devices or specialist treatments.
When should you seek medical advice?
Arrange a doctor's appointment if your erection issues are recurring, have started suddenly without an obvious explanation, or are affecting your confidence, relationships, or wellbeing. Seek advice sooner if you also have a noticeable drop in sexual desire, pain, a penile lump or curvature, or other new symptoms.
If you have an erection lasting four hours or longer, seek emergency medical care, as this can damage your penis if not treated promptly.
Patient picks for Men's sexual health

Men's health
9 signs of low testosterone in men
If you’ve been feeling unusually tired, moody, or losing interest in things you used to enjoy, low testosterone could be the reason - and it's more common than you think.
by Heather Ainsworth

Men's health
Is 'male menopause' real?
Menopause is a natural stage of life that women go through as they age. During this time, their reproductive hormone levels fluctuate and gradually decline, causing a range of physical and emotional symptoms. But can men experience something similar? Often referred to as ‘male menopause’, hormonal changes as men get older can also affect their health and wellbeing. We explore the symptoms, causes, and science behind 'male menopause' and why it deserves more attention.
by Victoria Raw
About the reviewerView full bio

Dr Colin Tidy, MRCGP
General Practitioner, Medical Author
MBBS, MRCGP, MRCP (Paediatrics), DCH
Dr Colin Tidy is an NHS Doctor, based in Oxfordshire.
Article history
Article also available in English, German, Spanish, French, Italian, Portuguese, Hindi, Hebrew, Arabic, and Swedish.
Next review due: 12 Nov 2029
10 Nov 2026 | Originally published
Authored by:
Thomas Andrew Porteus, MBCSPeer reviewed by
Dr Colin Tidy, MRCGP
Share your thoughts or experiences with others in our patient communities.
Sign up to the Patient newsletter
Your weekly dose of clear, trustworthy health advice - written to help you feel informed, confident and in control.
By subscribing you accept our Privacy Policy. You can unsubscribe at any time. We never sell your data.


