Hepatitis B spreads through contact with blood, semen, or other body fluids from an infected person. The virus does not spread through casual contact like hugging, sharing food, or coughing. Common ways people get hepatitis B include sexual contact with an infected person, sharing needles or syringes, accidental needle sticks in healthcare settings, and from mother to baby during birth. You can also get the virus from sharing personal items like razors or toothbrushes that may have traces of infected blood.
Your risk is higher if you were born in regions where hepatitis B is common, including parts of Asia, Africa, and the Pacific Islands. Other risk factors include living with someone who has chronic hepatitis B, working in healthcare or public safety roles with exposure to blood, receiving dialysis for kidney disease, and having HIV infection. People who inject drugs or have multiple sexual partners also face increased risk. Getting vaccinated is the best way to prevent hepatitis B infection.