You can protect yourself against hepatitis B infection by avoiding contact with the body fluids of someone whose health and sexual history aren't known to you. To prevent infection:
Hepatitis B vaccine
The hepatitis B vaccine is the most effective way to prevent infection. The vaccine is up to 95% effective against hepatitis B if you receive all the shots in the vaccination series (3 or 4 shots given at different times).2
Discuss vaccination with your doctor even if you aren't in one of the recommended groups. In the United States, about 15 out of 100 of those who become infected don't know how they got infected.4
In some cases, a doctor will order postvaccination testing to make sure you have developed immunity to the virus. People who need this testing include those who have an impaired immune system or those who are health care workers or sex partners of people who have chronic infection.
If you are exposed to the virus before you have received all of the shots in the vaccination series, you may be given a dose of hepatitis B immunoglobulin (HBIG) soon afterward. In most cases, this will prevent infection until the vaccine takes effect.
If you have had sex with someone who has hepatitis B and you haven't received all doses of the hepatitis B vaccine, you should receive a shot of HBIG-in addition to continuing the vaccine series-within 14 days of being exposed to the virus.
Avoiding spreading the virus if you have it
For more information on prevention, see: