Cramps !!!

I'm almost 5 weeks and I keep having cramps idk if it's on one side or not but they hurt, I'm really scared. Is this the sign of a miscarriage or ectopic pregnancy.. I'm so terrified someone help !