Pregnancy test

Is 9 days before your period too early to take a pregnancy test? When is the best time to take one? How soon can I take it?