Sperm can survive outside of a man’s body for a limited time. The length of time sperm can survive depends on various factors such as temperature, humidity, and the surface they are on. Generally, sperm can survive for a few minutes to a few hours when outside of the body.
In ideal conditions, such as in a warm and moist environment, sperm may last for a longer time. On the other hand, in dry or cold conditions, sperm can quickly die. Sperm that are exposed to air or dry surfaces, like clothing or toilet paper, will typically die faster than those in a more hospitable environment, such as in semen or vaginal fluid.
Remember while sperm can survive outside of the body, the likelihood of them fertilizing an egg decreases significantly over time. Sperm that are outside of this is not able to swim to the egg, so they are less likely to fertilize it. This is why it is recommended to use contraception if there is a risk of pregnancy, even if sperm have only been outside of the body for a short time.