earliest to find out gender?

Leah • Mommy to a beautiful rainbow baby; Adaleigh Rose 🌹 💓
What is the earliest you can find out the gender of the baby, and how do they test?