It really comes down to what you feel most comfortable with doing. I told my immediate family right away (like 2 minutes after the + came up on the test). But we chose not to tell our friends straight away (except for my best friend and his best friend). In the end it didn't matter as my friends figured it out by 9 weeks and my mom told everyone she came into contact with
