How does Viagra work?

Accredited COSRT and BACP therapist Amanda Barge
Reviewed By
Amanda Barge
Neurobiologist and science communicator Paula Vaidelauskaite
Medical review by
Paula Vaidelauskaite
Written by
Mojo's Research Team
Updated on
October 16, 2026
Published on
August 30, 2022
A middle-aged white man is about to put a little blue pill in his mouth. In his other hand, he holds a glass of water.
Table of contents
Chevron down icon

Viagra (sildenafil) works by increasing blood flow to the penis, which makes it easier to get and keep an erection when you're sexually aroused. It's usually taken about an hour before sex and can be taken anywhere from 30 minutes to 4 hours beforehand, but it doesn't normally cause an erection unless you're turned on (FDA, 2014).

When you're aroused, your body makes more of a chemical called cGMP, which relaxes the blood vessels in your penis so blood can flow in. An enzyme called PDE5 breaks cGMP down, and Viagra blocks that enzyme, so blood flow into the penis is easier to keep going (Corbin, 2004). Viagra doesn't treat stress or anxiety itself, but it can still help with erections when those play a part, and US urology guidelines suggest a mental health professional can help alongside treatment (Burnett et al., 2018).

Before you take Viagra, check with a doctor or pharmacist first, especially if you have heart problems or take other medicines. Never take it with nitrates or nitrites in any form, including some chest-pain medicines and the recreational drug "poppers," because the mix can make your blood pressure drop too low. Tell your doctor if you take alpha-blockers, a type of blood pressure or prostate medicine, and don't take Viagra more than once a day. Get medical help right away if an erection lasts more than 4 hours, or if you suddenly lose vision or hearing (FDA, 2014).

How does Viagra work in the body?

Viagra's active ingredient is sildenafil. To understand what sildenafil actually does, it helps to see what your body does on its own first.

Sexual stimulation sends nerve signals to the penis. Those signals release a molecule called nitric oxide. Nitric oxide raises the level of another molecule, cGMP, inside penile tissue. Higher cGMP relaxes smooth muscle in the corpus cavernosum, the spongy tissue that fills with blood during an erection.

As that muscle relaxes, blood vessels widen and more blood flows in, which is what makes an erection firm.

PDE5 breaks cGMP back down. That's one of several things that bring an erection to an end, along with sexual stimulation easing off and the smooth muscle tightening again. It's also normal for an erection to fade during sex and come back. Sildenafil blocks PDE5, so cGMP sticks around longer, which helps you keep an erection during sexual stimulation (Corbin, 2004). It supports your body's natural response, so it can't guarantee an erection or how long one lasts. Sildenafil doesn't create nitric oxide, and it doesn't create cGMP. It slows down the enzyme that would otherwise clear cGMP away.

Here is the same process laid out step by step.

StepWhat happens in the bodyResult
1. Arousal signalSexual stimulation triggers nerve signals to the penisNitric oxide is released
2. Nitric oxide → cGMPNitric oxide raises levels of cGMP in penile tissueSmooth muscle in the corpus cavernosum starts to relax
3. PDE5's normal jobPDE5 enzyme breaks cGMP back downOne of the ways an erection fades, along with less stimulation and the smooth muscle tightening
4. Viagra blocks PDE5Sildenafil inhibits PDE5, so cGMP isn't broken down as fastBlood vessels stay wider for longer, which helps maintain an erection during sexual stimulation

Other sources describe this same pathway, which lines up with the mechanism above (StatPearls, 2024).

Notice that arousal comes first in every version of this chain. It's why Viagra needs sexual stimulation to work.

What are the common side effects of Viagra?

The most common side effects are headache, flushing (a red, warm face), indigestion or heartburn, a stuffy nose, a color tint to your vision, back pain, and dizziness (FDA, 2014).

Heartburn happens because sildenafil relaxes smooth muscle elsewhere in the body too, which can loosen the valve that normally keeps stomach acid down. If that happens to you, here's how to deal with the heartburn side effect from Viagra. If flushing is the problem, here's how to get rid of red face from Viagra.

Why won't Viagra work without arousal?

Viagra helps along a process your body has already started. It doesn't start that process itself. Without the nerve signals and nitric oxide release that begin with arousal, there's no rise in cGMP for Viagra's PDE5-blocking effect to protect, so it doesn't normally produce an erection on its own.

This is why a pill can support an erection but can't create desire or calm anxiety by itself. If low desire or anxiety is part of the problem, other kinds of support can work alongside it.

Physical vs. psychological causes of ED

Doctors often sort the causes of erectile dysfunction into physical and psychological, but in real life the two often overlap. Many men have a mix of both, and one can feed the other. Viagra works on blood flow, so it can help in many cases, including when stress or anxiety is part of the picture.

Type of factorExamples
Physical factorsHeart disease, diabetes, kidney disease, hypertension, nervous system conditions, nerve damage after prostate surgery, certain blood-pressure medications
Psychological factorsPerformance anxiety, stress, relationship conflict, depression, negative body image, past sexual trauma

The physical list above covers conditions that can affect blood vessels, nerves, or hormone levels, which is why they can interfere with an erection even when arousal and desire are both present (Yafi et al., 2016). Heart disease and diabetes, for example, can harm the small blood vessels and nerves an erection depends on, so blood flow may be reduced. The effect varies a lot from man to man, and having one of these conditions doesn't mean erections are off the table. Nerve damage after prostate surgery can interrupt the signal traveling from the brain to the penis, even when the blood vessels themselves are healthy.

Psychological factors can get in the way before arousal builds, and anxiety can also make an erection fade after arousal has already started. They can affect the body too. Anxiety, for example, can act on blood vessels through the body's threat response, which we cover below. Relationship conflict and past sexual trauma can make the brain link sex with tension instead of safety.

If you want a clearer picture of what's behind your own ED, here's how to tell if ED is physical or psychological.

Can Viagra help with psychological ED?

It can help with the erection itself, but it doesn't treat the stress, anxiety, or other factors behind it. US urology guidelines say men with ED should be told about medicines like Viagra as a treatment option, and that doctors should consider referring men to a mental health professional, for example to reduce performance anxiety (Burnett et al., 2018). Our guide on whether Viagra helps psychological ED goes into more detail.

Dr. Ramesh Krishnan, a board-certified urologist with more than 20 years in practice, puts it plainly: "They can give you a one-off erection, but they can't treat the underlying cause." The pill supports blood flow, and the worry behind the problem needs its own attention.

For some men, a pill that doesn't work as hoped can add pressure. A man who already worries about performing may take it as a sign that something is badly wrong, and feel more anxious next time. This doesn't happen to everyone, and knowing what Viagra can and can't do before you try it can help.

Combining approaches looks promising. In one small trial of young men in Pakistan whose ED had no physical cause, sex therapy based on cognitive behavioral therapy (CBT) improved erection scores compared with a placebo, and so did the same therapy combined with Viagra (Bilal & Abbasi, 2022). One study in one country can't settle the question, but it fits the idea that talking support and medication can work together.

Mojo's Erection Reset program, built by Dr. Shannon Chavez, focuses on the psychological side of ED.

How can anxiety affect erections?

Anxiety is one common way psychological factors affect erections, though it isn't the only one. Amanda Barge, an accredited COSRT and BACP therapist, explains that psychological erectile dysfunction can involve the body's fight-or-flight response. Anxiety can switch on the sympathetic nervous system, the part of the body that reacts to a threat. Stress hormones like adrenaline then tighten blood vessels and send blood toward the muscles you'd use to run or fight, and away from the penis.

That's why a healthy man can feel turned on and still lose an erection when he's anxious. Viagra doesn't calm this reaction, but it may still help with the erection while anxiety is present. Managing the anxiety itself is a separate job.

Other psychological factors work in different ways. Low desire, depression, distraction, and relationship problems can all play a part, with or without a threat response.

Next steps if Viagra isn't solving the problem

If Viagra isn't working for you, talk to a doctor. A doctor can help work out why and what to try next. Viagra not working doesn't by itself mean the cause is psychological. Common reasons include:

  • Timing. It's usually taken about an hour before sex, and taking it too late or too early can make a difference (FDA, 2014).
  • A heavy, high-fat meal. This can delay how quickly it gets into your blood by about an hour.
  • Not enough sexual stimulation. Viagra needs arousal to work, so it won't do much without it.
  • The dose. A doctor can raise or lower your dose to find what works for you.
  • Underlying health conditions. A doctor can check for physical causes like heart disease, diabetes, or blood pressure problems (Yafi et al., 2016).

If stress or anxiety is part of the picture, medication and psychological support can work side by side. Erection treatment options beyond medication focus on those factors.

That's where Mojo's Erection Reset program comes in. Built with Dr. Shannon Chavez, it focuses on the psychological factors that can affect erections, like stress and performance anxiety. It doesn't diagnose or treat ED. It gives you tools and exercises to work on those factors, and you can use it alongside medical care.

FAQs

Does Viagra cure erectile dysfunction?
Chevron down icon

No. It blocks PDE5, an enzyme that breaks down cGMP, which helps blood flow into the penis during arousal (Corbin, 2004). It doesn't cure ED or treat what's causing it.

How long does Viagra take to work, and how long does it last?
Chevron down icon

Viagra reaches its highest level in your blood 30 minutes to 2 hours after you take it, usually around an hour. A high-fat meal can slow this down by about an hour. That's why it's usually taken about an hour before sex, though it can be taken anywhere from 30 minutes to 4 hours beforehand. Separately, the amount in your blood halves about every 4 hours, which shows how fast your body clears it rather than exactly how long the effect lasts (FDA, 2014).

Why do I need to be aroused for Viagra to work?
Chevron down icon

Because the drug helps along a process your body has already started. At normal doses, sildenafil doesn't produce an erection without sexual stimulation, though it still has other effects in the body, such as a small drop in blood pressure (FDA, 2014).

Can Viagra help if my ED is psychological?
Chevron down icon

It can help with the erection, though it doesn't treat stress or anxiety itself. US guidelines suggest doctors consider referring men to a mental health professional alongside treatment, for example to help with performance anxiety (Burnett et al., 2018). For some men, a pill that doesn't work as hoped can add to the worry, so it helps to know what to expect.

Who shouldn't take Viagra?
Chevron down icon

Don't take it if you use nitrates or nitrites in any form, including "poppers," or if you're allergic to sildenafil. Check with a doctor first if you have heart problems or take alpha-blockers or other blood pressure medicines (FDA, 2014).

What are the physical causes of ED?
Chevron down icon

Heart disease, diabetes, kidney disease, hypertension, nervous system conditions, nerve damage after prostate surgery, and certain blood-pressure medications (Yafi et al., 2016).

Is Viagra the only option for erection difficulties?
Chevron down icon

No. Other medicines in the same family, like tadalafil, work in a similar way (Corbin, 2004). Erection treatment options beyond medication also exist, including approaches for the psychological side of ED, and many men use more than one.

Sources

  1. Bala, A., et al. (2024). PDE5 inhibitors. In StatPearls. StatPearls Publishing. https://www.ncbi.nlm.nih.gov/books/NBK549843/
  2. Bilal, A., & Abbasi, N. U. H. (2022). Randomized placebo controlled trial of sildenafil citrate, cognitive behavior sex therapy and integrated treatment in men diagnosed with non organic erectile dysfunction. Sexual Medicine, 10(1), Article 100464. https://doi.org/10.1016/j.esxm.2021.100464
  3. Burnett, A. L., Nehra, A., Breau, R. H., et al. (2018). Erectile dysfunction: AUA guideline. Journal of Urology, 200, 633. https://www.auanet.org/guidelines-and-quality/guidelines/erectile-dysfunction-(ed)-guideline
  4. Corbin, J. D. (2004). Mechanisms of action of PDE5 inhibition in erectile dysfunction. International Journal of Impotence Research, 16(Suppl 1), S4–S7. https://doi.org/10.1038/sj.ijir.3901205
  5. U.S. Food and Drug Administration. (2014). VIAGRA (sildenafil citrate) tablets, for oral use: Full prescribing information (Revised 03/2014). https://www.accessdata.fda.gov/drugsatfda_docs/label/2014/20895s039s042lbl.pdf
  6. Yafi, F. A., Jenkins, L., Albersen, M., Corona, G., Isidori, A. M., Goldfarb, S., Sangkum, P., & Hellstrom, W. J. G. (2016). Erectile dysfunction. Nature Reviews Disease Primers, 2, 16003. https://doi.org/10.1038/nrdp.2016.3
Editorial standards

Mojo aims to provide useful wellbeing resources to its users; however, you should not solely rely on opinions or advice available on the Website or given by the Community. Always seek advice from a qualified medical doctor or other healthcare professional before acting.

About the experts

Accredited COSRT and BACP therapist Amanda Barge
Amanda Barge
accredited COSRT and BACP therapist

With 18 years as an accredited COSRT and BACP therapist, Amanda helps people navigate desire, intimacy, and the changes life brings.

Learn more
Next arrow
Neurobiologist and science communicator Paula Vaidelauskaite
Paula Vaidelauskaite
Neurobiologist & science communicator

A neurobiologist and science communicator, Paula turns research on the brain, behaviour and health into clear, evidence-based education about mental, physical, and sexual well-being.

Learn more
Next arrow
Support for the mental side of ED
Dismiss

The Erection Reset gives you tools for the stress and anxiety that can affect erections.