Protecting yourself with pepper spray is legal in all 50 states, but there are restrictions on how you can use it. As a general rule, you can use it in self-defense to protect yourself from a real and immediate threat. As a self-defense product, pepper spray is not meant to permanently disable the attacker. Rather, it's a diversionary tool that can give you time to get away safely.
You shouldn't go to jail for using pepper spray in genuine self defense.
Pepper Spray is Legal in All States
It is legal to possess pepper spray in all 50 states. However, possession and use are regulated in most jurisdictions. In Nevada, for example, you're restricted from carrying more than two fluid ounces of pepper spray; in Wisconsin, you cannot camouflage the container. Massachusetts classifies pepper spray as a type of ammunition that can only be carried by someone with a legal firearms permit obtained from a police department. Most states have rules against using pepper spray on law enforcement officials.
Proportionate and Necessary Force
In most states, it's acceptable to defend yourself from an unlawful attack. The important thing is that you're acting in self defense, and that you use force which is "necessary" and "proportionate" to the threat you're experiencing. For example, if someone pulled a gun on you, using your pepper spray would likely be seen as an act of self defense. If you pulled out your pepper spray just because you didn't like the look of someone, a court might decide that your response was neither "necessary" nor "proportionate."
It is illegal to hurt someone intentionally. If you use your pepper spray on someone for a reason other than self-defense, there's a chance that you will end up in court. The same applies if you were acting in self-defense but you provoked the original attack. For example, you cannot threaten violence with a weapon and then claim self-defense if the person retaliates in some way, causing you to use your pepper spray. If witnesses testify that you were the aggressor, then you will not be justified in using your pepper spray.
Making a Case For Self Defense
If you hurt someone with your pepper spray, whether in self-defense or otherwise, it's possible that you could end up in court charged with some type of assault. It is up to you and your defense attorney to prove there was legal justification for self defense. If you were truly defending yourself and you can prove it, then it is unlikely that you would be convicted of a crime. However, if a court decides that you used the spray improperly, you could be fined up to $1000 or imprisoned for up to three years, depending on the jurisdiction.