The Bible never explicitly mentions masturbation or states whether or not masturbation is a sin. The Scripture most frequently pointed to in regards to masturbation is the story of Onan in Genesis 38:9-10. Some interpret this passage as saying that “spilling your seed” on the ground is a sin. However, that is not precisely what the passage is saying. God condemned Onan not for “spilling his seed” but because Onan refused to fulfill his duty to provide an heir for his brother. The passage is not about masturbation, but rather about fulfilling a family duty. A second passage sometimes used as evidence for masturbation’s being a sin is Matthew 5:27-30. Jesus speaks against having lustful thoughts and then says, “If your right hand causes you to sin, cut it off and throw it away.” While there are parallels between this passage and masturbation, it is unlikely that masturbation was what Jesus was alluding to.
While the Bible nowhere explicitly states that masturbation is a sin, there is no question as to whether the actions that lead to masturbation are sinful. Masturbation is nearly always the result of lustful thoughts, sexual stimulation, and/or pornographic images.