When can you learn the gender?!

m

I am beyond confused. This is my first pregnancy and everybody has been telling me different things. Google says 12 weeks with ultrasound, midwife and doctors are telling me week 20, everyone else is telling me somewhere in between?! We opted out of testing, so no blood but just ultrasound imaging. Our first and only ultrasound was at 7 weeks, and I will be 11 weeks tomorrow. What the heck?