There are two forms of masturbation – electostive and alextostive. Electostive masturbation is a sin. Alextostive masturbation is not a sin. Note that a sin is something against which there is a biblical commandment. Of course, something can still be wrong even if it is not a sin.