No, it isn’t safe. Although the sperm doesn’t get in your vagina, the pre-ejaculate does. You risk catching or passing on a sexually transmitted disease, or getting pregnant.
More importantly, it’s easy for the man to get the timing wrong and pull out too late.
Sexually transmitted diseases
The pre-ejaculate (the clear liquid that comes out of the penis before the man comes) can carry HIV (the virus which causes AIDS) or another sexually transmitted disease such as chlamydia, gonorrhoea, genital herpes, genital warts, syphilis or trichomoniasis.
If you’re on the pill, it will stop you getting pregnant but it won’t protect you from getting sexually transmitted diseases.
Withdrawal is not a very effective method of contraception. There may be sperm cells in the pre-ejaculate.