Gas pain vs Miscarriage cramps

How can you tell the difference? This morning I woke up and had the worst pain ever! It was on the sides of my stomach not just low but far up too and middle. It lasted for about 5-10 seconds then went away. I’m scared that this is the beginning of a MC.