user658: 
Is masturbation wrong? In what exact way is it wrong? I just need to know if the act of masturbation is wrong. This may include watching nudity while masturbating. Even though it's an addiction, I was wandering if it hold more or any negative karma than another general addiction, like addiction to food. I just need your opinion in this backed up by references to the teachings.  
Is the act of masturbation a barrier towards mental concentration or samadhi? Will I have more mindfulness and concentration if I get rid of this addiction? I'm talking about the samadhi gained through annapanasati.
In what way can I get rid of this addiction if it is leading me away from the path? Please give instructions to one who is somewhat deeply ingrained in it.

I am not here to discuss about an 'embarrassing' topic, rather a plausible problem (affirmed by many Buddhists) that a majority of people in the western world have. I am also here to see if my addiction can be a cause for any other negative habits, like many Buddhist say so. That being said, thank you very much for the help. I honestly will appreciate the answer you give me, since this idea have haunted and caused inner conflicts within me for the past 2 years.    

user-1: With regard to this question, I would like to offer the following essay, too long to re-post here, done a decade ago concering the topic: Sex and the Lay Buddhist.
http://obo.genaud.net/dhammatalk/bd_dhammatalk/ethical_culture/sex_andthe_lay_buddhist.htm
There are some very efficacious practices for ending the habit of sexual indulgence described in this essay. In addition I would now add:
There comes a time when one's detachment is such that temptation to sexual pleasure of any sort does not even enter the mind. Prior to that there is a period when there is sufficient detachment from sexual pleasures to allow one to say on the first even very tiny approach of temptation: "No thank you, thank you very much." Prior to that there comes a time when one is sufficiently detached that although allowing confrontation with temptation one is able to extract one's self before it gets out of hand ... so to speak. Prior to that there is a period when one indulges for a time, for a longer time, for a very long time but without going so far as to ooze any liquid (see simile for the first jhana).
I would also suggest, in addition to the suggestions in the article cited: eliminate any props. You do not want to end like a certain actor, hanging upside down on a cross with a noose around your neck from a coat rack in a second rate hotel in Thailand. Keep it in your head. Use the Eightfold path. This sort of thing, most purely sexual fantasy requires violence. Violence is to be let go. Get rid of the props, then get rid of the violence from the fantasy. If the fantasy can be made into a love or romantic fantasy, it becomes very alian to an outright sexual fantasy.
Another thing: Keep at it. That is the effort to abstain. Look at the spaces, not the failures. Extend the periods between failures.
It can be done.

user-1: What makes something "right or wrong" in Buddhism? The answer is, are your thoughts and actions leading towards or away from purification and liberation of the mind, if your actions are leading to freedom from suffering then the act is "wholesome" but if your thoughts and actions are leading you away from purification of the mind, then your actions are " unwholesome" ( The Noble Eightfold Path)
So, to answer your question on masturbation, will masturbating lead to purification and liberation of the mind? The answer is clearly no. The action itself is leading to more craving and desire of an action which doesn't support your journey towards freedom from all pain and suffering!
The answer to the 3rd part of your question is....simply to meditate. Once your mind becomes more focused, more concentrated ( mindfulness) within each and every moment, then when the desire and craving for masturbation arises, you will see the arisen phenomena earlier and earlier, which means the "hook" of the craving and desire has a less hold on you each time. Just meditated and increase your AWARENESS!! 
I hope this has helped.
Metta.

user3527: I applaud your effort to ask this matter so candidly.
I have not read a Buddhist story that directly discusses the matter of masturbation but, as a Chinese Buddhist, there are many Chinese influences/wisdom, that we also study as electives, that discusses the matter of masturbation.
Chinese Buddhists often build our foundation with some aspects in Confucianism and Daoism, before diving into Mahayana. Historically many Buddhist masters are not only expert in Buddhism, but often are highly educated in Confucianist and Daoist scripture and skills.
The matter of masturbation and sexuality in general are often discussed in the context of Chinese medicine, which is a Daoist influence (I often think of Daoists as ancient Chinese scientists and engineers). Chinese medicine consider masturbation highly detrimental to one's health, and people should refrain from frequent sexual conduct to conserve more energy.
Whilst most modern medicine I encountered asserts masturbation is harmless, as the only vital material that is lost from the human body is protein and nutrients, which easily regenerates over time. Chinese medicine speculates beyond matter (i.e. semen), understands the world is composed of matter, energy, and information, and with each ejaculation a lot of energy is lost, which does most damage to the kidneys. For men aged between 30 ~ 40, this energy cycle takes about 2 weeks to replenish, and as we get older the cycle takes even longer. Chinese medicine highly recommend men to completely abstain after the age of 60, if you wish to enjoy longevity. In short, don't do it, it's good for your health.
Masturbation is also considered unwholesome sexual conduct. Confucianism teaches filial piety as the top priority of being a virtuous person. Our bodies are born from our mothers, through months of labor and hardship through birth, and then nourished and nurtured carefully by our parents. Therefore, Confucianism considers looking after our health as an essential component of filial piety. Not only is masturbation an unhealthy act, but it is also a shameful scene to behold if one were to be accidentally exposed to the public.
Based on the above, I do believe masturbation is a great hinderance towards samadhi.
Lastly, like any worldly attachments, I believe such an addiction can be resolved by practicing Buddhism diligently. Meditation does wonders. I have a Hare Krisna friend whom, after practicing meditation, naturally lost interest in meat and became a vegan with ease.
There are many ways and teachings in the Buddhist scriptures so simply find a way that is most suitable for one's circumstances. One of the most recommended approach is through 'Disgusting Thoughts' (asubhānupassin), by visualizing our fleshy bodies in separate parts in high details (the brain, stomach, skin, fecal matter, blood, pus etc) and see through what our bodies are really made of. The essence of desire is emptiness and relative. A mosquito would find another mosquito sexually attractive, but another creature, e.g. us human-beings, or a dog, would have no interest. In the eyes of the Devas, even the most attractive super models are merely foul hideous apes.
Please allow me to be frank (sorry everyone for the TMI) but, I too, had the same addiction for over 10 years. I was under the pretense it is harmless, but in retrospective, this behavior had adversed affected me psychologically. I was often shrouded with shame, I lack confidence, it warped my expectation with relationships and I could not experience satisfactory relationship.
I dropped the habit 'magically' after a few weeks practicing Buddhism. I have always admired and respected Buddhism, and when I first started to study it seriously, many of my bad habits just naturally faded. I deleted all adult material, eat healthy, went vegetarian, and now married and become a first time dad.
Sorry if the above sound a bit cliche. I'm still afflicted by lingering wandering thoughts, but at least I have not broken action precepts. I hope in time, and through diligent practice, all these anxiety will turn into Bodhi.

user43: Sorry, no links to texts, just my personal experience/ingisht:

Is masturbation wrong?

It's not exactly wrong, rather it is a symptom of an underlying issue. The issue is probably deep craving for positive emotion, for love, for acceptance, for appreciation. This deep craving could be a result of child trauma. This trauma may affect other areas of your life, such as your relationship with success and challenge, your interpersonal relationships etc. So even though masturbation in and of itself is not bad, the issue behind is serious and must be analyzed with all seriousness, and then a strategy for overcoming should be developed and worked on.

Is the act of masturbation a barrier towards mental concentration or samadhi?

Not a permanent barrier, but definitely a negative factor. Samadhi, or ability to generate and maintain a certain context and mood, relies on power of will (along with other powers, such as imagination etc). The power of will is a direction of energy opposite to the desire of satisfaction/relief. So training to channel your energy into e.g. physical endurance exercises instead of habitually releasing it, will do miracles to your ability to deal with stress, to control your focus and therefore your perspective and your mood.

In what way can I get rid of this addiction?

Learn to always be in a positive mood, and it will naturally subside. When you are bright and shining, your brain will continuously produce the same hormone that is released during orgasm. Do abdominal exercises.

user832: Sexuality is mentioned and that does include sex between man and woman, same sex partners and self pleasuring.
But there is a clear delineation between monks who have take their vows and lay people.
http://en.wikipedia.org/wiki/Buddhism_and_sexuality

To lay people Buddha advised that they should at least avoid sexual
  misconduct which meant following generally accepted norms of sexual
  morality and behavior. From Buddha's full-time disciples, the ordained
  monks and nuns, strict celibacy (called brahmacarya) has always been
  required.

But what is the issue with sexuality. Shakyamuni Buddha had been married and surrounded by women before he was married, per his father the king's devices to keep Shakyamuni interested in assuming the throne after the king died.
So Buddha spoke from experience. What is he trying to tell us?

In the Buddha's first discourse he identifies craving (tanha) as the
  cause of suffering (dukkha). He then identifies three objects of
  craving: the craving for existence; the craving for non-existence and
  the craving for sense pleasures (kama). Kama is identified as one of
  five hindrances to the attainment of jhana according to the Buddha's
  teaching. Throughout the Sutta Pitaka Buddha often compares sexual
  pleasure to arrows or darts. So in the Kama Sutta from the Sutta
  Nipata Buddha explains that craving sexual pleasure is a cause of
  suffering. —Kama Sutta, Sutta Nipata[1]

So really the issue is not sex or no sex, but what to do with craving. As lay people, a long term relationship is one way of expressing these cravings, but even so sex is not the answer to our deepest longing to awaken to Buddha consciousness.
Buddha goes on to explain in greater detail what is the problem.

If one, longing for sexual pleasure, achieves it, yes, he's enraptured
  at heart. The mortal gets what he wants. But if for that person —
  longing, desiring — the pleasures diminish, he's shattered, as if shot
  with an arrow.
  —Kama Sutta, Sutta Nipata[1]

So the aspirant is shot with the arrow of disappointment. But this disappointment can be a prod to try harder to see beyond the lie that sensual satisfaction will really give lasting fulfillment. It isn't a matter of whether the rules say to do or not do sex, but what will this act do for my practice.
There is another post on onions and garlic and how those are best avoided. So there may be things one can do to lessen the craving. What was the motivation for the prohibition on eating onions and garlic?
Buddha then goes on to say:

So one, always mindful, should avoid sexual desires. Letting them go,
  he will cross over the flood like one who, having bailed out the boat,
  has reached the far shore.
The 'flood' refers to the deluge of human suffering. The 'far shore'
  is nibbana, a state in which there is no sexual desire.
The meaning of the Kama Sutta is that sexual desire, like any habitual
  sense pleasure, brings suffering.

So that is the crux of the matter "any habitual sense pleasure, brings suffering."
So that gets us back to the Four Noble truths. And now we are in the heart of Buddhism, finding a way out of suffering.

658: <ol>
<li><p>Is masturbation wrong? In what exact way is it wrong? I just need to know if the act of masturbation is wrong. This may include watching nudity while masturbating. Even though it's an addiction, I was wandering if it hold more or any negative karma than another general addiction, like addiction to food. I just need your opinion in this backed up by references to the teachings.  </p></li>
<li><p>Is the act of masturbation a barrier towards mental concentration or samadhi? Will I have more mindfulness and concentration if I get rid of this addiction? I'm talking about the samadhi gained through annapanasati.</p></li>
<li><p>In what way can I get rid of this addiction if it is leading me away from the path? Please give instructions to one who is somewhat deeply ingrained in it.</p></li>
</ol>

<p>I am not here to discuss about an 'embarrassing' topic, rather a plausible problem (affirmed by many Buddhists) that a majority of people in the western world have. I am also here to see if my addiction can be a cause for any other negative habits, like many Buddhist say so. That being said, thank you very much for the help. I honestly will appreciate the answer you give me, since this idea have haunted and caused inner conflicts within me for the past 2 years.    </p>
 -1: <p>With regard to this question, I would like to offer the following essay, too long to re-post here, done a decade ago concering the topic: Sex and the Lay Buddhist.</p>

<p><a href="http://obo.genaud.net/dhammatalk/bd_dhammatalk/ethical_culture/sex_andthe_lay_buddhist.htm" rel="nofollow">http://obo.genaud.net/dhammatalk/bd_dhammatalk/ethical_culture/sex_andthe_lay_buddhist.htm</a></p>

<p>There are some very efficacious practices for ending the habit of sexual indulgence described in this essay. In addition I would now add:</p>

<p>There comes a time when one's detachment is such that temptation to sexual pleasure of any sort does not even enter the mind. Prior to that there is a period when there is sufficient detachment from sexual pleasures to allow one to say on the first even very tiny approach of temptation: "No thank you, thank you very much." Prior to that there comes a time when one is sufficiently detached that although allowing confrontation with temptation one is able to extract one's self before it gets out of hand ... so to speak. Prior to that there is a period when one indulges for a time, for a longer time, for a very long time but without going so far as to ooze any liquid (see simile for the first jhana).</p>

<p>I would also suggest, in addition to the suggestions in the article cited: eliminate any props. You do not want to end like a certain actor, hanging upside down on a cross with a noose around your neck from a coat rack in a second rate hotel in Thailand. Keep it in your head. Use the Eightfold path. This sort of thing, most purely sexual fantasy requires violence. Violence is to be let go. Get rid of the props, then get rid of the violence from the fantasy. If the fantasy can be made into a love or romantic fantasy, it becomes very alian to an outright sexual fantasy.</p>

<p>Another thing: Keep at it. That is the effort to abstain. Look at the spaces, not the failures. Extend the periods between failures.</p>

<p>It can be done.</p>
 -1: <p>What makes something "right or wrong" in Buddhism? The answer is, are your thoughts and actions leading towards or away from purification and liberation of the mind, if your actions are leading to freedom from suffering then the act is "wholesome" but if your thoughts and actions are leading you away from purification of the mind, then your actions are " unwholesome" ( The Noble Eightfold Path)</p>

<p>So, to answer your question on masturbation, will masturbating lead to purification and liberation of the mind? The answer is clearly no. The action itself is leading to more craving and desire of an action which doesn't support your journey towards freedom from all pain and suffering!</p>

<p>The answer to the 3rd part of your question is....simply to meditate. Once your mind becomes more focused, more concentrated ( mindfulness) within each and every moment, then when the desire and craving for masturbation arises, you will see the arisen phenomena earlier and earlier, which means the "hook" of the craving and desire has a less hold on you each time. Just meditated and increase your AWARENESS!! </p>

<p>I hope this has helped.</p>

<p>Metta.</p>
 3527: <p>I applaud your effort to ask this matter so candidly.</p>

<p>I have not read a Buddhist story that directly discusses the matter of masturbation but, as a Chinese Buddhist, there are many Chinese influences/wisdom, that we also study as electives, that discusses the matter of masturbation.</p>

<p>Chinese Buddhists often build our foundation with some aspects in Confucianism and Daoism, before diving into Mahayana. Historically many Buddhist masters are not only expert in Buddhism, but often are highly educated in Confucianist and Daoist scripture and skills.</p>

<p>The matter of masturbation and sexuality in general are often discussed in the context of Chinese medicine, which is a Daoist influence (I often think of Daoists as ancient Chinese scientists and engineers). Chinese medicine consider masturbation highly detrimental to one's health, and people should refrain from frequent sexual conduct to conserve more energy.</p>

<p>Whilst most modern medicine I encountered asserts masturbation is harmless, as the only vital material that is lost from the human body is protein and nutrients, which easily regenerates over time. Chinese medicine speculates beyond matter (i.e. semen), understands the world is composed of matter, energy, and information, and with each ejaculation a lot of energy is lost, which does most damage to the kidneys. For men aged between 30 ~ 40, this energy cycle takes about 2 weeks to replenish, and as we get older the cycle takes even longer. Chinese medicine highly recommend men to completely abstain after the age of 60, if you wish to enjoy longevity. In short, don't do it, it's good for your health.</p>

<p>Masturbation is also considered unwholesome sexual conduct. Confucianism teaches filial piety as the top priority of being a virtuous person. Our bodies are born from our mothers, through months of labor and hardship through birth, and then nourished and nurtured carefully by our parents. Therefore, Confucianism considers looking after our health as an essential component of filial piety. Not only is masturbation an unhealthy act, but it is also a shameful scene to behold if one were to be accidentally exposed to the public.</p>

<p>Based on the above, I do believe masturbation is a great hinderance towards samadhi.</p>

<p>Lastly, like any worldly attachments, I believe such an addiction can be resolved by practicing Buddhism diligently. Meditation does wonders. I have a Hare Krisna friend whom, after practicing meditation, naturally lost interest in meat and became a vegan with ease.</p>

<p>There are many ways and teachings in the Buddhist scriptures so simply find a way that is most suitable for one's circumstances. One of the most recommended approach is through 'Disgusting Thoughts' (asubhānupassin), by visualizing our fleshy bodies in separate parts in high details (the brain, stomach, skin, fecal matter, blood, pus etc) and see through what our bodies are really made of. The essence of desire is emptiness and relative. A mosquito would find another mosquito sexually attractive, but another creature, e.g. us human-beings, or a dog, would have no interest. In the eyes of the Devas, even the most attractive super models are merely foul hideous apes.</p>

<p>Please allow me to be frank (sorry everyone for the TMI) but, I too, had the same addiction for over 10 years. I was under the pretense it is harmless, but in retrospective, this behavior had adversed affected me psychologically. I was often shrouded with shame, I lack confidence, it warped my expectation with relationships and I could not experience satisfactory relationship.</p>

<p>I dropped the habit 'magically' after a few weeks practicing Buddhism. I have always admired and respected Buddhism, and when I first started to study it seriously, many of my bad habits just naturally faded. I deleted all adult material, eat healthy, went vegetarian, and now married and become a first time dad.</p>

<p>Sorry if the above sound a bit cliche. I'm still afflicted by lingering wandering thoughts, but at least I have not broken action precepts. I hope in time, and through diligent practice, all these anxiety will turn into Bodhi.</p>
 43: <p>Sorry, no links to texts, just my personal experience/ingisht:</p>

<ol>
<li>Is masturbation wrong?</li>
</ol>

<p>It's not exactly wrong, rather it is a symptom of an underlying issue. The issue is probably deep craving for positive emotion, for love, for acceptance, for appreciation. This deep craving could be a result of child trauma. This trauma may affect other areas of your life, such as your relationship with success and challenge, your interpersonal relationships etc. So even though masturbation in and of itself is not bad, the issue behind is serious and must be analyzed with all seriousness, and then a strategy for overcoming should be developed and worked on.</p>

<ol start="2">
<li>Is the act of masturbation a barrier towards mental concentration or samadhi?</li>
</ol>

<p>Not a permanent barrier, but definitely a negative factor. Samadhi, or ability to generate and maintain a certain context and mood, relies on power of will (along with other powers, such as imagination etc). The power of will is a direction of energy opposite to the desire of satisfaction/relief. So training to channel your energy into e.g. physical endurance exercises instead of habitually releasing it, will do miracles to your ability to deal with stress, to control your focus and therefore your perspective and your mood.</p>

<ol start="3">
<li>In what way can I get rid of this addiction?</li>
</ol>

<p>Learn to always be in a positive mood, and it will naturally subside. When you are bright and shining, your brain will continuously produce the same hormone that is released during orgasm. Do abdominal exercises.</p>
 832: <p>Sexuality is mentioned and that does include sex between man and woman, same sex partners and self pleasuring.</p>

<p>But there is a clear delineation between monks who have take their vows and lay people.
<a href="http://en.wikipedia.org/wiki/Buddhism_and_sexuality" rel="noreferrer">http://en.wikipedia.org/wiki/Buddhism_and_sexuality</a></p>

<blockquote>
  <p>To lay people Buddha advised that they should at least avoid sexual
  misconduct which meant following generally accepted norms of sexual
  morality and behavior. From Buddha's full-time disciples, the ordained
  monks and nuns, strict celibacy (called brahmacarya) has always been
  required.</p>
</blockquote>

<p>But what is the issue with sexuality. Shakyamuni Buddha had been married and surrounded by women before he was married, per his father the king's devices to keep Shakyamuni interested in assuming the throne after the king died.
So Buddha spoke from experience. What is he trying to tell us?</p>

<blockquote>
  <p>In the Buddha's first discourse he identifies craving (tanha) as the
  cause of suffering (dukkha). He then identifies three objects of
  craving: the craving for existence; the craving for non-existence and
  the craving for sense pleasures (kama). Kama is identified as one of
  five hindrances to the attainment of jhana according to the Buddha's
  teaching. Throughout the Sutta Pitaka Buddha often compares sexual
  pleasure to arrows or darts. So in the Kama Sutta from the Sutta
  Nipata Buddha explains that craving sexual pleasure is a cause of
  suffering. —Kama Sutta, Sutta Nipata[1]</p>
</blockquote>

<p>So really the issue is not sex or no sex, but what to do with craving. As lay people, a long term relationship is one way of expressing these cravings, but even so sex is not the answer to our deepest longing to awaken to Buddha consciousness.</p>

<p>Buddha goes on to explain in greater detail what is the problem.</p>

<blockquote>
  <p>If one, longing for sexual pleasure, achieves it, yes, he's enraptured
  at heart. The mortal gets what he wants. But if for that person —
  longing, desiring — the pleasures diminish, he's shattered, as if shot
  with an arrow.
  —Kama Sutta, Sutta Nipata[1]</p>
</blockquote>

<p>So the aspirant is shot with the arrow of disappointment. But this disappointment can be a prod to try harder to see beyond the lie that sensual satisfaction will really give lasting fulfillment. It isn't a matter of whether the rules say to do or not do sex, but what will this act do for my practice.</p>

<p>There is another post on onions and garlic and how those are best avoided. So there may be things one can do to lessen the craving. <a href="https://buddhism.stackexchange.com/questions/5325/what-was-the-motivation-for-the-prohibition-on-eating-onions-and-garlic">What was the motivation for the prohibition on eating onions and garlic?</a></p>

<p>Buddha then goes on to say:</p>

<blockquote>
  <p>So one, always mindful, should avoid sexual desires. Letting them go,
  he will cross over the flood like one who, having bailed out the boat,
  has reached the far shore.</p>
  
  <p>The 'flood' refers to the deluge of human suffering. The 'far shore'
  is nibbana, a state in which there is no sexual desire.</p>
  
  <p>The meaning of the Kama Sutta is that sexual desire, like any habitual
  sense pleasure, brings suffering.</p>
</blockquote>

<p>So that is the crux of the matter "any habitual sense pleasure, brings suffering."</p>

<p>So that gets us back to the Four Noble truths. And now we are in the heart of Buddhism, finding a way out of suffering.</p>
